10/15/2015

Ubuntu Quick install Apache, PHP, and create public_html


Install Apache and MySQL

sudo apt-get install apache2 mysql-client mysql-server php5-mysql

Visiting your server in your web browser
















Create a public_html folder by User

sudo a2enmod userdir
sudo service apache2 reload
Of course, you'll also need to make sure that the permissions on your public_html folder allow the www-data user to see the files in there -- 755 usually works well. To do this:
mkdir ~/public_html
chmod -R 755 ~/public_html
So that, Apache can access files in Home directory

Install PHP 

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

Test PHP

<?php
phpinfo();
?>
The address you want to visit will be:
http://localhost/info.php















Enable PHP in UserDir
sudo vim /etc/apache2/mods-enabled/php5.conf






sudo /etc/init.d/apache2 restart

No comments:

Post a Comment