Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
devops-intern-training
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Văn Vũ
devops-intern-training
Commits
9887a4d0
Commit
9887a4d0
authored
Feb 23, 2024
by
Nguyễn Văn Vũ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Week1 - Install nginx, php, mysql and wordpress on ubuntu
parent
307b4276
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
setup.sh
week1/setup.sh
+61
-0
No files found.
week1/setup.sh
0 → 100644
View file @
9887a4d0
#!/bin/bash
sudo
apt update
# Install nginx
sudo
apt
install
-y
nginx
# Install mysql-server
sudo
apt
install
-y
mysql-server
# Create a database that WordPress can use
sudo
mysqladmin create wordpress
sudo
mysql
mysql> CREATE USER wordpress@localhost identified by
'wordpress123'
;
mysql> GRANT ALL on wordpress.
*
to wordpress@localhost
;
mysql>
exit
sudo
mysql
mysql> SET PASSWORD
for
wordpress@localhost
=
'wordpress123'
;
mysql>
exit
# Install PHP
sudo
apt
install
-y
php-fpm
#Install the required PHP modules.
sudo
apt
install
-y
php-mysql php-curl php-mbstring php-imagick php-xml php-zip
#Configure NGINX
sudo
bash
-c
'cat > /etc/nginx/sites-available/default <<EOF
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
}
EOF'
sudo
systemctl reload nginx
#Download WordPress
cd
curl
-O
https://wordpress.org/wordpress-5.6.tar.gz
#Extract WordPress and Move It Into the DocumentRoot
tar
xvf wordpress-5.6.tar.gz
sudo mv
wordpress/
*
/var/www/html
#Assign File Permissions for WordPress
sudo chown
-R
www-data:www-data /var/www/html
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment