Difference between revisions of "LAMP"
Rafahsolis (talk | contribs) |
Rafahsolis (talk | contribs) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 7: | Line 7: | ||
sudo mysql_install_db | sudo mysql_install_db | ||
mysql_secure_installation </nowiki> | mysql_secure_installation </nowiki> | ||
| + | |||
| + | <source lang="mysql"> | ||
| + | mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass'; | ||
| + | mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' | ||
| + | -> WITH GRANT OPTION; | ||
| + | mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass'; | ||
| + | mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' | ||
| + | -> WITH GRANT OPTION; | ||
| + | </source> | ||
4.- Install PHP | 4.- Install PHP | ||
<nowiki>sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt</nowiki> | <nowiki>sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt</nowiki> | ||
| Line 52: | Line 61: | ||
<nowiki>mkdir /var/www/html/wp-content/uploads | <nowiki>mkdir /var/www/html/wp-content/uploads | ||
sudo chown -R :www-data /var/www/html/wp-content/uploads</nowiki> | sudo chown -R :www-data /var/www/html/wp-content/uploads</nowiki> | ||
| + | |||
| + | 9.- Access Control | ||
| + | Apache provides access control based on client hostname, IP address, or other characteristics of the client request using mod_access module. | ||
| + | |||
| + | Open your httpd.conf file: | ||
| + | # vi /etc/httpd/conf/httpd.conf | ||
| + | Locate directory section (for example/var/www/sub/payroll) and set it as follows: | ||
| + | |||
| + | <Directory /var/www/sub/payroll/> | ||
| + | Order allow,deny | ||
| + | Allow from 192.168.1.0/24 | ||
| + | Allow from 127 | ||
| + | </Directory> | ||
9.- Completar la instalación accediendo a la url | 9.- Completar la instalación accediendo a la url | ||
Fuente: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04 | Fuente: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04 | ||
Latest revision as of 17:55, 30 September 2017
Insalar Linux Apache MySQL PHP (LAMP)
1.- Crear una instancia en Amazon AWS con Ubuntu 14
2.- Instalar Apache: sudo apt-get install apache2
to change 404 edit: sudoedit /etc/apache2/conf.d/localized-error-pages (plaintext or html)
3.- Instalar MySQL
sudo apt-get install mysql-server php5-mysql sudo mysql_install_db mysql_secure_installation
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
-> WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
-> WITH GRANT OPTION;
4.- Install PHP
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
5.- Modify the order that Apache uses for loading pages: sudo nano /etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
Change phpmyadmin path:
edit:
/etc/phpmyadmin/apache.conf
change Alias /phpmyadmin /usr/share/phpmyadmin
to:
Alias /someothername /usr/share/phpmyadmin
restart apache: sudo service apache2 restart
Instalar Wordpress
1.- Crear base de datos para wordpress en MySQL
mysql -u root -p CREATE DATABASE rafawpsite;
2.- Crear usuario en MySQL
CREATE USER rafaweb@localhost IDENTIFIED BY 'RafaTeVasA0lviD4r';
3.- Dar permisos al nuevo usuario para acceder a la base de datos creada anteriormente
GRANT ALL PRIVILEGES ON rafawpsite.* TO rafaweb@localhost; FLUSH PRIVILEGES;
exit 4.- Descargar wordpress:
cd ~ wget http://wordpress.org/latest.tar.gz tar xzvf latest.tar.gz sudo apt-get update sudo apt-get install php5-gd libssh2-php
5.- Configurar wordpress
cd ~/wordpress cp wp-config-sample.php wp-config.php nano wp-config.php
Definir los valores para DB_NAME, DB_USER, y DB_PASSWORD 6.- Copiar los archivos al directorio donde cargara la web apache
sudo rsync -avP ~/wordpress/ /var/www/html/
7.- Cambiar los permisos
cd /var/www/html sudo chown -R demo:www-data *
8.- Crear directorio para uploads y asignarle los permisos correctos
mkdir /var/www/html/wp-content/uploads sudo chown -R :www-data /var/www/html/wp-content/uploads
9.- Access Control Apache provides access control based on client hostname, IP address, or other characteristics of the client request using mod_access module.
Open your httpd.conf file:
- vi /etc/httpd/conf/httpd.conf
Locate directory section (for example/var/www/sub/payroll) and set it as follows:
<Directory /var/www/sub/payroll/> Order allow,deny Allow from 192.168.1.0/24 Allow from 127 </Directory> 9.- Completar la instalación accediendo a la url
Fuente: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04