-
Notifications
You must be signed in to change notification settings - Fork 6
LAMP Initialization for Projects (For Beginners)
Run localhost in the web browser. Check for message (”it works”).
And
Create a php file with codes
<?php_
_phpinfo();
_?>
& run localhost command again in the web browser
It should give info about PHP.
( check version of Apache apache2 -v
)
cd into apache folder ( cd /etc/apache2/sites-available)
Enter the code in terminal
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/crowdfunding
Then enter code -
sudo gedit crowdfunding
The apache server by default points to /var/www .It needs to pointed to the git repo in your system. Get the location of the git repo using pwd command inside the terminal after "cd"ing into the your git repo folder. At two places& change them at two places
from /var/www/ to “location of git repo”
save the file & exit gedit. Get back to the terminal
sudo a2dissite default
sudo a2ensite crowdfunding
sudo service apache2 restart
command for streaming the apache error log
tail -f /var/log/apache2/error.log
cd into apache folder ( cd /etc/apache2/sites-available)
Enter the code in terminal
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/crowdfunding.conf
Then enter code -
sudo gedit crowdfunding.conf
The apache server by default points to /var/www .It needs to pointed to the git repo in your system.
Get the location of the git repo using pwd
command inside the terminal
after "cd"ing into the your git repo folder.
Look for DocumentRoot and change /var/www/ to “location of git repo” ( Eg: /home/rj/work_git/crowdfund-scholarships). save the file & exit gedit.
Now enter code -
sudo gedit default-ssl.conf
Look for DocumentRoot and repeat above step.
Save & close the editor & cd into apache2 folder ( cd ..
).
Now enter code -
sudo gedit default-ssl.conf
Copy the directory tag below, replace /var/www with your git repo directory, & paste it in the file right below where this tag ends. <Directory /var/www> ..
<Directory /var/www> Options Indexes FollowSymLinks AllowOverride None Require all granted
sudo a2dissite 000-default.conf
sudo a2ensite crowdfunding.conf
sudo service apache2 restart
PS : Test this by typing localhost in the web browser. If any error, run the following code
sudo apt-get install libapache2-mod-php5
sudo service apache2 restart
To access database "cd" into the
first time - } mysql -u root -p < LearnEmp.sql
( -u root implies root user & -p is for entering password).
enter password you had registered the first time when installing Lamp.
Next time, use _myql -u root -p_