User Tools

Site Tools


apache_vhost_centos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
apache_vhost_centos [2015/12/14 11:26] luke7858apache_vhost_centos [2024/05/23 07:26] (current) – external edit 127.0.0.1
Line 10: Line 10:
 <sxh bash> <sxh bash>
 <VirtualHost *:80> <VirtualHost *:80>
-    ServerName e.com +    ServerName example.com 
-    ServerAlias www.e.com +    ServerAlias www.example.com 
-    DocumentRoot /var/www/vhosts/e.com+    DocumentRoot /var/www/vhosts/example.com/public_html
  
-    <Directory /var/www/vhosts/e.com>+    <Directory /var/www/vhosts/example.com/public_html>
         Options Indexes FollowSymLinks         Options Indexes FollowSymLinks
         AllowOverride None         AllowOverride None
Line 26: Line 26:
 </sxh> </sxh>
 \\ \\
 +Globally change website from example.com to your required domain:
 +<sxh bash>
 +:%s/example.com/newwebsite.com
 +</sxh>
 === Reloading Apache Configuration === === Reloading Apache Configuration ===
-Once the vhost has been created you will need to reload apache for the configuration to take effect:\\ +Once the vhost has been created you will need to reload apache for the configuration to take effect\\
-CentOS/RHL 5,6: +
-<sxh bash>service httpd reload</sxh> +
-CentOS/RHL 7: +
-<sxh bash>systemctl reload httpd</sxh>+
  
 \\ \\
Line 49: Line 49:
 </sxh> </sxh>
 \\  \\ 
-Will will need to add an entry preventing other/all hidden files being served+Will will need to add an entry preventing other/all hidden files being served. Add the following content directly under the above content in the httpd.conf (apache2.conf file)
  
 +<sxh bash>
 +<LocationMatch ^(.*/)\..*>
 +  Order Allow,Deny
 +  Deny from All
 +  Satisfy All
 +</LocationMatch>
 +</sxh>
apache_vhost_centos.1450092390.txt.gz · Last modified: 2024/05/23 07:26 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki