sudo apt-get install apache2
Configure Virtual Hosting
sudo gedit /etc/apache2/ports.conf
NameVirtualHost ip static:80 //ip static : for example 91.98.42.111
save/quit
------------------------
sudo gedit
/etc/apache2/sites-available/default
NameVirtualHost ip static:80 //ip static : for example 91.98.42.111
save/quit
---------------------------
sudo gedit /etc/apache2/sites-available/yourdomain.com
<VirtualHost 12.34.56.78:80>
ServerAdmin YourEmail@YourDomain.com
ServerName YourDomain.com
ServerAlias www.YourDomain.com
DocumentRoot /srv/www/yourdomain.com/public_html/
ErrorLog /srv/www/yourdomain.com/logs/error.log
CustomLog /srv/www/yourdomain.com/logs/access.log combined
</VirtualHost>
save/quit
-------------------------------------------------------
make directory for your domain and wabsite
sudo mkdir -p /srv/www/
yourdomain.com/public_html
sudo mkdir /srv/www/
yourdomain.com/logs
------------------------------------------
set up your virtual hosts on your domain
sudo a2ensite
yourdomain.com
------------------------------------------
reload web server
sudo /etc/init.d/apache2 reload
-------------------------------------------------------
step 2 : Install and Configure the MySQL Database Server
sudo apt-get install mysql-server
Configure MySQL and Set Up Databases
secure mysql
sudo mysql_secure_installation
--------------------------------------
log in to MySQL
sudo mysql -u root -p
Enter MySQL's root password
--------------------------------------
create your database and set username.password create database
dbname;
grant all on
dbname.* to 'username' identified by 'password';
flush privileges;
quit
-------------------------------------
step 3: Install and Configure PHP
sudo apt-get install php5 php-pear
sudo gedit
/etc/php5/apache2/php.inimax_execution_time = 30
memory_limit = 64M
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE _ERROR
display_errors = Off
log_errors = On
error_log = /var/log/php.log
register_globals = Off
save/quit
-------------------------------------
restart apache
sudo /etc/init.d/apache2 restart
--------------------------------------
install other packeges
sudo apt-get install php5-mysqlsudo apt-get install php5-suhosin
-------------------------------------
restart apache
sudo /etc/init.d/apache2 restart
--------------------------------------
حالا شما میتونید فایل وب سایت خودتونو تو مسیر زیر کپی کرده و اونو اجرا کنید