ubuntu 12.04 LTS install apache2.4 and php 5.6 and setup vhost

1. don't do this!(or backup disk) apt-get purge php*;apt-get purge apache*
2.
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update && sudo apt-get upgrade 
3.
sudo apt-get install apache2 php5 libapache2-mod-php5; sudo apt-get install apache2-utils; sudo apt-get install php5-curl php5-gd php5-intl php5-mcrypt php5-mysql php5-odbc php5-dev
4. sudo gedit /etc/apache2/apache2.conf
after IncludeOptional sites-enabled/*.conf add 
      IncludeOptional sites-enabled/*
5. sudo touch /etc/apache2/sites-available/site.com
6. sudo gedit /etc/apache2/sites-available/site.com
<VirtualHost *:80>
 ServerAdmin mail@mail.ru
 ServerName site.com
 DocumentRoot /var/www/site.com/www
 <Directory /var/www/site.com/www>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Require all granted
 </Directory>

 ErrorLog /var/www/site.com/log/error.log

 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn

 CustomLog /var/www/site.com/log/access.log combined

</VirtualHost>

7. sudo ln -s /etc/apache2/sites-available/site.com /etc/apache2/sites-enabled/site.com
8. sudo /etc/init.d/apache2 restart
9. sudo gedit /etc/hosts
ad line 127.0.0.1 site.com
10. touch /var/www/site.com/www/index.html
gedit /var/www/site.com/www/index.html
add Hello world!
touch /var/www/site.com/www/index.php
gedit /var/www/site.com/www/index.php
add <?php echo phpinfo();?>
 
check in browser http://site.com/index.html && http://site.com/index.php
11. sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
// for ubuntu 13.10
apt-get install php5-json
// -------------
 
12.
sudo a2enmode headers
sudo gedit /etc/apache2/apache2.conf 
LoadModule headers_module modules/mod_headers.so 

13. /etc/init.d/apache2 restart

Популярные сообщения из этого блога

установка nginx + PHP5 + phpDaemon и настройка виртуальных хостов на nginx на Ubuntu 13.10

сказ о том, как я kafka и Spring поднимал и тестил