Set up lampp on linux - ubantu
Step1 : Update && upgrade package
sudo apt-get update && upgrade
Step 2: install apache2
sudo apt install apache2
Step3: Adjust the firewall to allow web traffic
sudo ufw app list
If you look at the
Apache Full
profile, it should show that it enables traffic to ports 80
and 443
:sudo ufw app info "Apache Full"
Step4: Set up your location suppose path is /home/gulshan/Projects && url will be http://projects
then for this set up
*Disable the old config*
sudo a2dissite 000-default.conf
*Create new config with name projects.conf*
*Add this to them*
*Add this to them*
<VirtualHost *:80>
ServerAdmin webmaster@projects
ServerName projects
ServerAlias projects
DocumentRoot /home/gulshan/Projects
<Directory /home/gulshan/Projects>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
*Save*
*Enable the projects.conf*
sudo a2ensite projects.conf
*Test the configration => O/P syntax OK *
sudo apache2ctl configtest
*Point http://projects to 127.0.0.1*
sudo nano /etc/hosts
127.0.0.1 localhost projects
***********************************************************
Step5: Install php & php-library (curl)
sudo apt install php libapache2-mod-php php-mysql
sudo apt-get install php-curl
sudo service apache2 reload
remove ';' from php.ini file from
;extension=curl.....
************************************************************
Step6: Install MySQL
sudo apt install mysql-server
sudo mysql_secure_installation
Do yes
provide password && do yes.....
Step7: Set up user in mysql
*Open mysql*
If new user
sudo mysql // if no user created
else if user exist
sudo mysql -u username -p //username is user created
//now type your password
Here to see the user list
SELECT user,authentication_string,plugin,host FROM mysql.user;
There is 2 option take already existing user root or create new user
I will create new user
//suppose username is gulshan && pwd man
CREATE USER 'gulshan'@'localhost' IDENTIFIED BY 'man';
GRANT ALL PRIVILEGES ON * . * TO 'gulshan'@'localhost';
FLUSH PRIVILEGES;
Boom Done
now download phpmyadmin
now download phpmyadmin
place it in you /home/gulshan/Projects/phpMyadmin && Access with https://projects/phpMyadmin
Step8: Enable error_reporting & htaccess
*Enabling display_error*
Go to php.ini file & Find display_error make it On
*Enable Httaccess*
a2enmod rewrite
systemctl restart apache2
Comments
Post a Comment