CentOS Apache Setting

Apache Install

# yum -y install httpd*
# /etc/rc.d/init.d/httpd start

Apache Setting

# vim /etc/httpd/conf/httpd.conf
  • change Home Directory & Setting Virtual Host
DirectoryIndex index.html index.html index.php
.
.
<VirtualHost *:80>
    DocumentRoot /home/user
    ServerName *
</VirtualHost>
  • Add your custom host
<VirtualHost proinlab.com>
    DocumentRoot /home/user
    ServerName proinlab.com
    ServerAlias www.proinlab.com
</VirtualHost>

 Permission Setting

  • change Apache home directory access permission
# chcon -R -t httpd_user_content_t /home
  • set user folder permission
# chmod 711 /home/user

set 711 or 755

Restart Apache

# /etc/rc.d/init.d/httpd restart

 

댓글 남기기