Difference between revisions of "Talk:Apache HTTP Server"

From ArchWiki
Jump to: navigation, search
m (PHP: @ test.php: new section)
(Added new discussion)
(27 intermediate revisions by 8 users not shown)
Line 23: Line 23:
 
[[User:Harlekin|harlekin]] 21:13, 13. Mai 2007 (GMT+1)
 
[[User:Harlekin|harlekin]] 21:13, 13. Mai 2007 (GMT+1)
  
== Restarting apache ==
+
== Using SSL ==
  
AFAIK, the only way that we should encourage users to restart apache is with '# apachectl restart' - this is far cleaner than to abruptly shut down the server
+
Could the SSL section be expanded to include how to use .htaccess and mod_rewrite to redirect traffic for certain sections or the whole site? I found [http://blackflag.wordpress.com/2006/06/13/apache2-forcing-all-inbound-traffic-to-ssl/ apache2-forcing-all-inbound-traffic-to-ssl] to be a useful resource in this respect. [[User:Corburn|Corburn]] 13:58, 23 March 2012 (EDT)
  
--[[User:Zenlord|Zenlord]] 05:16, 14 September 2010 (EDT)
+
== PHP: do not use mime type application/x-httpd-php ==
  
== HOSTNAME in rc.conf ==
+
I would recommend deleting this advice from the article:
  
It is not necessary to modyfiy HOSTNAME in rc.conf. I have different names in hosts and rc.conf and it works perfectly :). I've never had to modyfiy them in order to make it work. [[User:Zyx|Zyx]] 01:52, 23 May 2007 (EDT)
+
"Add this line in /etc/httpd/conf/mime.types:  
  
== Testing mysql daemon ==
+
application/x-httpd-php php php5"
  
Hi,
+
Isn't the whole point of PHP to run it on the server side and turn it into text/html?  Setting the MIME type as suggested here causes Firefox, for example, to offer to download the file or open it (in Notepad!!), instead of just presenting the HTML page.
  
"Test by visiting http://localhost/phpMyAdmin in a web browser"
+
--[[User:Gdweber|gdweber]] 2012 June 30
Phpmyadmin is not a dependency of mysql and installing it is not specified anywhere in the article ... This advice for testing mysql is irrelevant.
+
  
== Do we need the "http"-user section. ==
+
== <s> linux is software? </s> ==
  
Afaik, the http user is automatically added when you install apache. Do we need to tell the user to add a "http"-user then?
+
first sentence: combination of software linux, apache, mysql, php. i understand apache, mysql, and php, but i was under the impression that the linux kernel is not a form of software, more like a generic driver. [[User:Mojangsta|mojangsta]] ([[User talk:Mojangsta|talk]]) 23:36, 16 August 2013 (UTC)
 +
: Drivers are software, see [[Wikipedia:Software]] and its linked article [[Wikipedia:System software]]: code that runs on computer hardware is software. The term "[[Wikipedia:Application software|software application]]" is probably what you are mistaking this to mean. [[User:Ndt|Ndt]] ([[User talk:Ndt|talk]]) 02:38, 17 August 2013 (UTC)
 +
:: There is only two things in a computer: Hardware and software. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 13:50, 29 August 2013 (UTC)
  
Birger :)
+
== Wrong argument order? ==
 
+
<div style="border-style: dotted;">
== Updated 18 March 2010 ==
+
# usermod -aG http piter
 
+
</div>
I just did a fresh install of Apache and PHP5 and I have updated this article to reflect the defaults in the current Arch packages.  In particular I have clarified the section regarding PHP not being associated with .php extensions. [[User:Dibblethewrecker|dtw]]
+
Seems like usermod accepts group as first argument and user as second, unlike gpasswd. Please check. [[User:Axper|axper]] ([[User talk:Axper|talk]]) 12:06, 30 August 2013 (UTC)
 
+
== PHP ==
+
=== Testing PHP ===
+
php-5.3.2-6: There is no test.php in /srv/http, nor indeed is it listed when I run '# pacman -Ql php'.  The only file I found with 'test' in the name is /usr/lib/php/build/run-tests.php.  As /srv/http is actually empty after php is installed, I wonder if I'm missing something from th package.--[[User:Ial|Ial]] 02:09, 10 June 2010 (EDT)
+
 
+
== PHP ==
+
 
+
The section for including PHP directives in httpd.conf is ALL wrong(IMHO), this is not correct(though it DOES work):
+
'AddHander php5-script php' in: httpd.conf @ before '<IfModule ssl_module>'(is WRONG).
+
the way you are including php5 is messy & completely unnecesary.
+
 
+
The much easier(and proper way) is to only do these two things:
+
 
+
01. edit /etc/httpd/mime.types & add:
+
'application/x-httpd-php php'
+
 
+
02. edit /etc/httpd/httpd.conf & add this to the 'includes conf/extra/*.conf' list:
+
Include conf/extra/php5_module.conf
+
 
+
03. (optionally) uncomment this line in /etc/httpd/httpd.conf:
+
MIMEMagicFile conf/magic
+
(this will allow mime.type hints to help out on any later needed mime.types not specifically defined by hand in: /etc/httpd/httpd.conf or: /etc/httpd/mime.types)
+
 
+
It is ONLY neccesary to add the mime type for php in: mime.types, and include the line: Include conf/extra/php5_module.conf in: httpd.conf
+
 
+
This is much cleaner(and PROPER), and much easier to understand for your readers, please consider(and possibly correct) this.
+
 
+
Thank You,
+
-Sully.
+
 
+
== PHP: @ test.php ==
+
 
+
I will also confirm that there is no 'test.php' in: /srv/http/ it is NOT included in either the x86_64 or i686 iso's, I have confirmed both, dual_core image is unconfirmed.
+
 
+
For the sanity/sake of your wiki article, you might want to consider removing the section about /srv/http/test.php, and just say:
+
 
+
"create the file /srv/http/test.php and in it put: <?php phpinfo(); ?>, then navigate to http://localhost/test.php in your browser to confirm that php5 is functioning!
+
 
+
Thanks,
+
-Sully.
+

Revision as of 12:06, 30 August 2013

Be advised to set "allow_url_fopen" to "On" in /etc/php/php.ini in order to upgrade/update Wordpress properly from the admin panel. (does this info belong here?) --Rataxes 14:13, 23 July 2009 (EDT)


If the service httpd don't start, take a look at /var/log/httpd/error_log. If appears this line: -[alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "myhost" you must uncomment the line: LoadModule unique_id_module. Restart httpd and now it should work. --Nak 17:22, 22 April 2007 (GMT+1)


hmm.. doesnt mysql come in /usr/lib/mysql niot /var/lib/mysql as directed?? - ScriptDevil

Split this article

I hope this is what the page is for.

In my opinion setting up LAMP should not contain detailed information about how to set up parts of LAMP. It would be cleaner to only explain how to bring these parts to work together. Especially because of the explanation's integrity. Further more because then users will be able to find a standalone HOWTO for setting up these parts. For example you don't have to read through this page order to get MySQL working. Because of the mentioned integrity I think it would be best to create independent HOWTOs on how to setup MySQL, php and maybe even apache and refer to them from this page.

I've started with MySQL because I know how to setup it and because some parts in this HOWTO are not needed any more and because of that are just confusing.

harlekin 21:13, 13. Mai 2007 (GMT+1)

Using SSL

Could the SSL section be expanded to include how to use .htaccess and mod_rewrite to redirect traffic for certain sections or the whole site? I found apache2-forcing-all-inbound-traffic-to-ssl to be a useful resource in this respect. Corburn 13:58, 23 March 2012 (EDT)

PHP: do not use mime type application/x-httpd-php

I would recommend deleting this advice from the article:

"Add this line in /etc/httpd/conf/mime.types:

application/x-httpd-php		php php5"

Isn't the whole point of PHP to run it on the server side and turn it into text/html? Setting the MIME type as suggested here causes Firefox, for example, to offer to download the file or open it (in Notepad!!), instead of just presenting the HTML page.

--gdweber 2012 June 30

linux is software?

first sentence: combination of software linux, apache, mysql, php. i understand apache, mysql, and php, but i was under the impression that the linux kernel is not a form of software, more like a generic driver. mojangsta (talk) 23:36, 16 August 2013 (UTC)

Drivers are software, see Wikipedia:Software and its linked article Wikipedia:System software: code that runs on computer hardware is software. The term "software application" is probably what you are mistaking this to mean. Ndt (talk) 02:38, 17 August 2013 (UTC)
There is only two things in a computer: Hardware and software. -- Fengchao (talk) 13:50, 29 August 2013 (UTC)

Wrong argument order?

# usermod -aG http piter

Seems like usermod accepts group as first argument and user as second, unlike gpasswd. Please check. axper (talk) 12:06, 30 August 2013 (UTC)