Install Config Wiki

All about installing, configuring and troubleshooting

User Tools

Site Tools


install_apache_mysql_php_linux_ubuntu_server

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
install_apache_mysql_php_linux_ubuntu_server [2020/06/07 19:39] wikiadmininstall_apache_mysql_php_linux_ubuntu_server [2020/06/07 20:04] – [Creating Apache VirtualHost] wikiadmin
Line 75: Line 75:
 </VirtualHost> </VirtualHost>
 </code> </code>
 +
 +Create the appropriate directory structure in the file system, in accordance with the path specified in the above virtual host.conf file, and assign or grant the appropriate file permissions for the Apache webserver user (namely www-data:www-data).
 +
 +<code>
 +mkdir -p /var/www/www1.example.com/httpdocs
 +chmod 755 /var/www/www1.example.com/httpdocs
 +chown www-data.www-data /var/www/www1.example.com/httpdocs
 +</code> 
 +
 +You can now upload your project files (website) on **/var/www/www1.example.com/httpdocs/** directory. For example, create a default page **index.html** file to test virtual host configuration, such as follows:
 +
 +<code>
 +echo "<h1>site1.example.com</h1>" > /var/www/www1.example.com/httpdocs/index.html
 +</code>
 +
 +==== Next - Enable the First VirualHost ====
 +
 +Remember that we configured the first VirtualHost file under the /etc/apache2/sites-available/ directory.  However, it is necessary to enable or activate the VirtualHost under the /etc/apache2/sites-enabled/ directory (an apache directory to which there is no permission for direct access).
 +
 +Adjust the site-name and use the following command to enable this VirtualHost so that Apache can load this enabled configuration file when the Apache service is restarted (reloaded). so, to enable the new configuration VitualHost, adjust the site-name and run the following from the command line:
 +
 +<code>a2ensite site1.example.com</code>
 +
 +This enables the site in **/etc/apache2/sites-enabled**/
 +
 +To activate the new configuration by reloading Apache (to bring the site 'live' in the Apache web service), enter the following command:
 +
 +<code>service apache2 reload</code> 
 +
 +You will need to setup DNS address entries for this 'domain' and host header.  
 +
 +If you do not have the DNS ready, you can temporarily map the domain by making an entry in the /etc/hosts files.
 +
 +<code>
 +
 +192.168.2.163  www1.example.com
 +
 +</code>
 +
 +==== Creating Additional Virtual Hosts ====
 +
 +Repeat the above steps for site www1 by changing the site-name to whatever it will be, such as www2.exmample.com
  
  
install_apache_mysql_php_linux_ubuntu_server.txt · Last modified: 2020/06/08 23:20 by wikiadmin