суббота, 29 июня 2019 г.

Установка wordpress на virtualbox без сертификатов

hostname u1804

$ sudo apt update
$ sudo apt install mc samba
$ sudo apt install apache2

$ sudo apt-get install mariadb-server mariadb-client
$ sudo mysql_secure_installation

Enter current password for root (enter for none): Enter
Set root password? [Y/n] Y
New password: 12345
Re-enter new password: 12345
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y



$ sudo mysql -u root -p
 


$ sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mysql php7.2-gmp php7.2-curl php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-gd php7.2-xml php7.2-cli php7.2-zip



$ sudo nano /etc/php/7.2/apache2/php.ini

Изменить:

memory_limit = 256M

upload_max_filesize = 100M

max_execution_time = 360

#date.timezone

Сохранить.


$ sudo systemctl restart apache2.service

$ sudo nano /var/www/html/phpinfo.php

<?php phpinfo( ); ?>


Сохранить.

http://u1804/phpinfo.php

$ sudo mysql -u root -p
Enter password:

MariaDB [(none)]> CREATE DATABASE wpdatabase;

MariaDB [(none)]> CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'password';

MariaDB [(none)]> GRANT ALL ON wpdatabase.* TO 'wpuser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

MariaDB [(none)]> FLUSH PRIVILEGES;

MariaDB [(none)]> EXIT;

#$ mysql -u wpuser -p wpdatabase
#$ sudo mysql -u root -p
#MariaDB [(none)]> SET PASSWORD FOR 'wpuser'@'localhost' = PASSWORD('password');


$ cd /tmp

$ wget https://wordpress.org/latest.tar.gz

$ tar -xvzf latest.tar.gz

$ sudo mv wordpress /var/www/html/example.com

$ sudo chown -R www-data:www-data /var/www/html/example.com/

$ sudo chmod -R 755 /var/www/html/example.com/

$ sudo nano /etc/apache2/sites-available/example.com.conf

<VirtualHost *:80>
  ServerName u1804
  #ServerName example.com
  #ServerAlias www.example.com
  ServerAdmin admin@example.com
  DocumentRoot /var/www/html/example.com

  <Directory /var/www/html/example.com/>
       Options FollowSymlinks
       AllowOverride All
       Require all granted
  </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

  <Directory /var/www/html/example.com/>
       RewriteEngine on
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*) index.php [PT,L]
  </Directory>
</VirtualHost>

Сохранить.


$ sudo a2ensite example.com.conf

$ sudo a2enmod rewrite

$ sudo systemctl reload apache2



Имя базы данных:   wpdatabase
Имя пользователя:   wpuser
Пароль:                     password





Имя пользователя:  admin

Пароль:                    4ff97a90d4dd0d3d


Комментариев нет:

Отправить комментарий