Run these commands to install wordpress on InterServer VPS using Ajenti control panel.
apt install php-fpm php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip -y
systemctl restart nginx
systemctl restart php*-fpm
database install:
apt install mariadb-server mariadb-client -y
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
create database:
mysql -u root
CREATE DATABASE wp_db;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'YourStrongPassword';
GRANT ALL PRIVILEGES ON wp_db. TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
chown -R www-data:www-data /var/www/html
find /var/www/html -type d -exec chmod 755 {} ;
find /var/www/html -type f -exec chmod 644 {} ;
Install wordpress on html folder.
cd /var/www/html
wget https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz
Edit the file.
nano /etc/nginx/sites-available/default
Delete (Press Alt+Backspace for faster removal) all the existing code and replace with the below code. Don’t forget to change the domain name.
server {
listen 80;
listen [::]:80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourdomain.com www.yourdomain.com;
root /var/www/html;
index index.php index.html index.htm;
# SSL Certbot Location
ssl_certificate /etc/letsencrypt/live/nuvizo.site/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
nginx -t
systemctl reload nginx
Complete the wordpress website setup visiting the below address.
https://ipaddress:8000
