User Tools

Site Tools


lknog3:netops:lamp

Differences

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

Link to this comparison view

Next revision
Previous revision
lknog3:netops:lamp [2019/10/01 20:15] – created lknog_adminlknog3:netops:lamp [2023/01/31 14:21] (current) – external edit 127.0.0.1
Line 5: Line 5:
  
  
-Login to the vm. change to root user+Login to the vm via ssh. change to root user
 <code> <code>
 $sudo su $sudo su
Line 45: Line 45:
 </code> </code>
  
-Now go to your browser and type **http://www.your domain** and check whether you are able to access the apache test page.+Now go to your browser and type **http://www.yourdomain** and check whether you are able to access the apache test page.
  
 == MySQL Installation == == MySQL Installation ==
Line 83: Line 83:
 type in, type in,
 <code> <code>
-sudo apt-get -y install php7.2 libapache2-mod-php7.2+sudo apt-get -y install php libapache2-mod-php
 </code> </code>
 the switch –y will automatically put yes on the installation process when it is prompted. the switch –y will automatically put yes on the installation process when it is prompted.
Line 93: Line 93:
 To check php, lets create a test php file. To check php, lets create a test php file.
 <code> <code>
-sudo nano /var/www/html/info.php+sudo vi /var/www/html/info.php
 </code> </code>
 **Note**: /var/www/html/ is the default document root for apache in Ubuntu unless you have changed it in apache configuration. **Note**: /var/www/html/ is the default document root for apache in Ubuntu unless you have changed it in apache configuration.
Line 105: Line 105:
 Now let us call that file in a browser (e.g. http://www.yourdomain/info.php) Now let us call that file in a browser (e.g. http://www.yourdomain/info.php)
  
-If your PHP is working you will see all your php server settings in one single place.+If your PHP is working you will see all your php server settings in one single place.  
 + 
 +**For the security of your server make sure you delete info.php after testing** 
  
 == Enabling Virtual Hosts == == Enabling Virtual Hosts ==
Line 116: Line 118:
 Create index pages on each directories containing following. Create index pages on each directories containing following.
 <code> <code>
-sudo nano /var/www/web1/index.php+sudo vi /var/www/web1/index.php
 </code> </code>
 You may change the content as appropriate. You may change the content as appropriate.
Line 134: Line 136:
 Default host configuration is located in /etc/apache2/sites-available/000-default.conf which serves any requests coming to its domain name or IP address. To make other two domains work, lets create virtual host files for each domain names; Default host configuration is located in /etc/apache2/sites-available/000-default.conf which serves any requests coming to its domain name or IP address. To make other two domains work, lets create virtual host files for each domain names;
 <code> <code>
-sudo nano /etc/apache2/sites-available/web1.conf+sudo vi /etc/apache2/sites-available/web1.conf
 </code> </code>
 with the following content, with the following content,
lknog3/netops/lamp.1569960947.txt.gz · Last modified: 2023/01/31 14:21 (external edit)