Categories
CentOS

CentOS – Installing Apache and PHP5

CentOS comes with Apache v.2.2.3 and PHP v.5.1.6 and they are easily installed via the default CentOS Package Manager ‘yum’.

The advantage of using yum (as opposed to installing via source code) is that you will get any security updates (if and when distributed) and dependencies are automatically taken care of.


Apache Install

A basic Apache install is very easy:

sudo yum install httpd mod_ssl

ServerName

Oddly, the server does not start automatically when you install it so you have to do this by hand:

sudo /etc/init.d/httpd start

The first thing you will see is this error:

Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name,
using 127.0.0.1 for ServerName
Categories
Linux Ubuntu Web site การพัฒนาซอฟท์แวร์

เซ็ต Alias ของ Apache บน Ubuntu

พิมพ์ใน Terminal
sudo gedit /etc/apache2/sites-enabled/000-default
เพิ่ม

Alias /virtualname/ "/home/me/html/realdirectory/"
<Directory "/home/me/html/realdirectory/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

Save แล้วปิด แล้วรีสตาร์ท Apache

sudo /etc/init.d/apache2 restart
Categories
Database Linux Ubuntu Web site การพัฒนาซอฟท์แวร์

ลง LAMP Server บน Ubuntu

This tutorial was has been tested on Ubuntu 10.04, 10.10, 11.04, 11.10, 12.04 LTS Precise Pangolin. Also tested in LinuxMint13 and works fine.

Open terminal and Type the command :install it   first  with

sudo apt-get install tasksel

Now to install LAMP, type the taskel command in terminal :

sudo  tasksel

And select LAMP Server:

During the installation  you  will be  asked  to insert the  mysql root  password

Now check if php is working :

$sudo vi /var/www/info.php

and add

<?php
phpinfo();
?>

save and exit

restart apache2 ,

#sudo /etc/init.d/apache2 restart

Now open browser and type :

http://ip/info.php or http://localhost/info.php

Php is installed.

To full manage  your  lamp Server database, install  phpmyadmin

sudo  apt-get  install  phpmyadmin

To login  to phpmyadmin, open browser and type :

http://ip/phpmyadmin   or http://localhost/phpmyadmin

 

– ที่มา http://www.unixmen.com/install-lamp-with-1-command-in-ubuntu-1010-maverick-meerkat/