I. LAMP
Linux-Apache-MySQL-PHPInstall
sudo apt-get update
sudo apt-get install lamp-server^
Minde the caret(^) at the end.
II. HOW TO REMOVE LAMP
Certifique-se que não outro programa que precise dos pacotes.Pode causar danos caso remova todos os pacotes
apache2
apache2-mpm-prefork
apache2-utils
apache2.2-common
libapache2-mod-php5
libaprl
libapruti11
libdbd-mysql-perl
libdbi-perl
libnet-daemon-perl
libp1rpc-perl
libpq5
mysql-client-5.5
mysql-common
mysql-server
mysql-server-5.5
php5-common
php5-mysql
Para remover o debconf data, use purge quando for remover
sudo apt --purge remove debconf
sudo apt --purge remove mysql-client-core-5.5
sudo apt --purge remove mysql-server-core-5.5
III. INSTALL APACHE2
sudo apt-get install apache2sudo /etc/init.d/apache2 restart ou;
sudo service apache2 restart
Checking Apache2 installation
go to the http://localhost:
content of the file - /var/www/html/index.html
Troubles with Apache2
use a text editor like nano or vim
sudo nano /etc/apache2/conf-available/fqdn.conf
então adicione no final
ServerName localhost
Save it, and enable your new configuration
sudo a2enconf fqdn or;
echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf && sudo a2enconf fqdn
Ubuntu 13.04
sudo nano /etc/apache2/conf.d/fqdn
then add ServerName localhost
echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
Virtual hots
apache2 tem duas concepção de site
pode ser separado para leitura que estão em /etc/apache2/sites-avaible there is one available called 000-default
create a new site:
copy the default website
sudo cp /etc/apache2/sites-available/000-default.conf
/etc/apache2/sites-available/mysite.conf
edit new configuration with your prefer editor
sudo vi /etc/apach2/sites-available/mysite.conf
chance the DocumentRoot para a nova localização
ex: /home/user/public_html/
in the file: /etc/apache2/apache2.conf change the Directory directive, replace <Directory /var/www/html/ > to <Dirctory /home/user/public_html
you can also set separate logs for each site. to do this change ErrorLog and CustomLog directives, optional save the file now we must desactive the old site, and active new
sudo a2dissite 000-default && sudo a2ensite mysite
a2ensite > apache2 enable site
a2dissite > apache2 disable site
restart apache2
sudo /etc/init.d/apache2 restart
to test the new site
echo '<b>Hello! It is woriking!</b>' > /home/user/public_html/index.html
finally browse to http://localhost/
IV. INSTALL PHP
sudo ap-get install phpInstall > libapache2-mod-php5
Enable > sudo a2enmod php5
Checking PHP Installation
create a new file "test.php" and write in it "<?php phpinfo(); ?>"
V. INSTALL MYSQL
sudo apt-get install mysql-serverAfter installing Mysql
set mysql bind address
sudo nano etc/mysql/my.cnf or
etc/mysql/mysql.conf.d/mysql.cnf
change the line > bind-address = localhost
to your own > bind-address = 192.168.0.20
if your ip is dynamic you can comment out the bind-address line
Set mysql root password
mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD ('yourpass');
If you have already
mysql -u root -p
Crate a mysql database
mysql> CREATE DATABASE database1;
Create a mysql user
mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourname'@'localhost'
IDENTIFIED BY 'yourpass' WITH GRANT OPTION;
mysql> \q to exit
-----------
Fonte: https://help.ubuntu.com/community/ApacheMySQLPHP
Curso de PHP
Nenhum comentário:
Postar um comentário