How To Set Up Apache 2.4, PHP 5.5, MySQL on Ubuntu 14.10
Installing Apache 2.4
sudo apt-get install apache2
sudo mkdir -p /var/www/test.loc/www sudo mkdir -p /var/www/test.loc/logs
Usage of -p allows the creation of nested directories specified in the path.
sudo nano /etc/apache2/sites-available/test.loc.conf
<VirtualHost *:80> ServerName test.loc ServerAlias www.test.loc DocumentRoot /var/www/test.loc/ <Directory /var/www/test.loc/> AllowOverride All </Directory> CustomLog /var/www/test.loc/logs/access.log common ErrorLog /var/www/test.loc/logs/error.log LogLevel warn </VirtualHost>
Save and Save As are both accomplished with the Write Out command, Ctrl+O.
When prompted, press enter to accept the existing file name.
sudo a2ensite test.loc
sudo nano /etc/hosts
127.0.1.1 test.loc
Installing MySQL
You need install MySQL as follows:sudo apt-get install mysql-server mysql-client
Installing PHP
Using the repository of Ondřej Surý, we can install both stable versions of Apache 2.4 and PHP 5.5.x just following this simple steps. Add the launchpad repository to your system:sudo apt-get install software-properties-common python-software-properties sudo add-apt-repository ppa:ondrej/php5 sudo apt-get update
sudo apt-get install php5
sudo nano /var/www/test.loc/index.php
<?php phpinfo();
sudo service apache2 restart
To get MySQL support in PHP, you can install the php5-mysql package. Also install some other PHP5 modules which possible need for your applications:
sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
Installing phpMyAdmin
Before installation unit you need to make sure that you have MySQL server and
php with required modules installed.
sudo apt-get install phpmyadmin
After the installation has been completed, you need to include phpmyadmin to the apache configuration:
sudo nano /etc/apache2/apache2.conf
Include /etc/phpmyadmin/apache.conf
To go down to the end of the file, press Ctrl+V.
sudo service apache2 restart
ที่มาset-up-apache-2-4-php-5-5-mysql-on-ubuntu-14-10
ไม่มีความคิดเห็น:
แสดงความคิดเห็น