scoopcas.blogg.se

Install apache centos 7
Install apache centos 7





install apache centos 7

If Apache can't match the requested domain to any of the virtual hosts, the first (alphabetically) virtual host site will be loaded. Save and close the file by pressing ESC, typing :wq, and pressing ENTER.

install apache centos 7

You can add as many as domains to nf file, just copy the VirtualHost block above and change the values for each domain you add. With your site directory and sample index file in place, you are almost ready to create the virtual host files. Next, create a sample index.html page # echo "Welcome to My virtual host Website" > /var/www/sites/domain1/index.html Make sure that your web root has the default permissions set: sudo chmod -R 755 /var/www Next, assign ownership of the page directory with the $USER environmental variable: # sudo chown -R $USER:$USER /var/www/sites/domain1/page # sudo mkdir -p /var/www/sites/domain1/log There are many ways to setup a virtual host, but we will explain one of the simplest methods here.įirst create directory structure for your_domain as follows, using the -p flag to store log files and any necessary html page or other content: # sudo mkdir -p /var/www/sites/domain1/page This section only useful, if you want to host more than one domain (virtual host) on the same Apache web server.







Install apache centos 7