Difference between revisions of "Talk:Apache HTTP Server"

From ArchWiki
Jump to: navigation, search
m (LAMP Guide?: rm closed discussion)
m (Added User Directories discussion as indicated from main page regarding minimum permission for apache userdir)
Line 20: Line 20:
  
 
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)
 
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 Directories ==
 +
 +
Continuing discussion from the main page, you do '''not''' have to make your home directory ''world-readable'' in order to make your ''public_html'' directory available to the web server. To minimize home directory exposure, I generally set the permission for both ''/home/$USER'' and ''/home/$USER/public_html'' to '''0750''' and change the group ownership to '''http'''. E.g.:
 +
 +
mkdir -p $HOME/public_html
 +
chmod 0750 $HOME $HOME/public_html
 +
chown $USER:http $HOME $HOME/public_html
 +
 +
That way you have given only '''read''' (descend into) permission to the web server user for both your home directory and your userdir. [[User:Drankinatty|David C. Rankin, J.D.,P.E. -- Rankin Law Firm, PLLC]] ([[User talk:Drankinatty|talk]]) 07:22, 25 August 2015 (UTC)
  
 
== userdir disable ==
 
== userdir disable ==

Revision as of 07:23, 25 August 2015

PID-errors

Keep getting PID-errors: systemd[1]: PID file /run/httpd/httpd.pid not readable (yet?) after start. (even when modules/mod_unique_id.so is disabled)

About the PHP Installation, mod_mpm_prefork seems not the best choice: https://serverfault.com/questions/383526/how-do-i-select-which-apache-mpm-to-use/383634#383634 I would vote for mod_proxy_handler

Beta990 (talk) 15:14, 16 March 2014 (UTC)

unique_id_module

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)

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)

User Directories

Continuing discussion from the main page, you do not have to make your home directory world-readable in order to make your public_html directory available to the web server. To minimize home directory exposure, I generally set the permission for both /home/$USER and /home/$USER/public_html to 0750 and change the group ownership to http. E.g.:

mkdir -p $HOME/public_html
chmod 0750 $HOME $HOME/public_html
chown $USER:http $HOME $HOME/public_html

That way you have given only read (descend into) permission to the web server user for both your home directory and your userdir. David C. Rankin, J.D.,P.E. -- Rankin Law Firm, PLLC (talk) 07:22, 25 August 2015 (UTC)

userdir disable

I think that section need add:

#LoadModule userdir_module modules/mod_userdir.so

to fully disable userdir.

Jabalv (talk) 18:48, 25 December 2013 (UTC)

According to [1]:
"User directory substitution is not active by default in versions 2.1.4 and later. In earlier versions, UserDir public_html was assumed if no UserDir directive was present."
So I think it is safe to just not include the conf. --Lonaowna (talk) 18:20, 23 August 2014 (UTC)