-
-
Save UbuntuEvangelist/d23b87ce2e2fdd83acccadec2e3e070d to your computer and use it in GitHub Desktop.
To install playsms with nginx on Ubuntu Linux, you can follow these steps: | |
1. Update your Ubuntu system: | |
sudo apt update | |
sudo apt upgrade | |
2. Install the necessary packages: | |
sudo apt install nginx php-fpm php-mysql php-curl php-gd php-intl php-mbstring php-xml php-zip mariadb-server | |
3. Start the services: | |
sudo systemctl start nginx | |
sudo systemctl start php7.4-fpm | |
sudo systemctl start mariadb | |
4. Configure the database: | |
sudo mysql_secure_installation | |
sudo mysql -u root -p | |
CREATE DATABASE playsmsdb; | |
CREATE USER 'playadmin'@'localhost' IDENTIFIED BY 'PlyP@ssWord79'; | |
GRANT ALL PRIVILEGES ON playsmsdb.* TO 'playadmin'@'localhost'; | |
use playsmsdb; | |
FLUSH PRIVILEGES; | |
exit | |
5. Download and extract playsms: | |
cd /var/www/html/ | |
sudo wget https://github.com/playsms/playsms/archive/master.zip | |
sudo unzip master.zip | |
sudo mv playsms-master playsms | |
sudo chown -R www-data:www-data playsms | |
cd /var/www/html/playsms | |
cp install.conf.dist install.conf | |
nano install.conf | |
#These are values I set on install.conf: | |
DBUSER="playadmin" | |
DBPASS="PlyP@ssWord79" | |
DBNAME="playsmsdb" | |
DBHOST="localhost" | |
DBPORT="3306" | |
WEBSERVERUSER="www-data" | |
WEBSERVERGROUP="www-data" | |
# Path to playSMS extracted source files | |
PATHSRC="/home/playsms/src/playSMS" | |
PATHWEB="/var/www/html/playsms" | |
PATHLIB="/var/lib/playsms" | |
PATHBIN="/usr/local/bin" | |
PATHLOG="/var/log/playsms" | |
PATHCONF="/etc" | |
#Run playSMS Install Script | |
cd /home/playsms/src/playSMS | |
./install-playsms.sh | |
#Adjust config.php | |
nano /var/www/html/playsms/config.php | |
#Inside config.php: | |
Search for logstate and set it to 3 | |
Search for ishttps and set it to true | |
6. Create a new nginx configuration file: | |
sudo nano /etc/nginx/sites-available/playsms.conf | |
7. Paste the following configuration in the file and save it: | |
server { | |
listen 80; | |
server_name your_domain.com; | |
root /var/www/html/playsms; | |
index index.php; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
fastcgi_pass unix:/run/php/php7.4-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} | |
8. Enable the new configuration and restart nginx: | |
sudo ln -s /etc/nginx/sites-available/playsms.conf /etc/nginx/sites-enabled/ | |
sudo systemctl restart nginx | |
9. Open the playsms web interface in your browser and complete the installation process: | |
http://your_domain.com/playsms/ | |
That's it! You have now successfully installed playsms with nginx on Ubuntu Linux. | |
PS I love you. And i asked the Ask AI app to write this for me. Get it for free --> https://get-askai.app |
UbuntuEvangelist
commented
May 15, 2024
1 passwd
2 nano /etc/ssh/sshd_config
3 service ssh restart
4 ls
5 sudo apt install mc unzip
6 apt install mariadb-server
7 sudo apt install software-properties-common
8 sudo add-apt-repository ppa:ondrej/php
9 sudo apt install mariadb-server nginx php7.2 php7.2-cli php7.2-fpm php7.2-mysql php7.2-gd php7.2-curl php7.2-mbstring php7.2-xml php7.2-zip language-pack-id -y
10 nano /etc/nginx/sites-available/playsms.confnano /etc/nginx/sites-available/playsms.conf
11 nano /etc/nginx/sites-available/playsms.conf
12 ln -s /etc/nginx/sites-available/playsms.conf /etc/nginx/sites-enabled/
13 nginx -t
14 systemctl restart nginx
15 apt install python3-certbot-nginx -y
16 adduser playsms
17 usermod -a -G sudo playsms
18 cd /home/playsms
19 mkdir -p public_html log
20 sudo chmod 775 /home/playsms public_html log
21 sudo chown playsms.playsms -R /home/playsms
22 sudo chown www-data.playsms -R /home/playsms/log
23 ls -l /home/playsms
24 cd /home/playsms
25 mkdir -p bin etc lib src
26 sudo chmod 775 bin etc lib src
27 #Prepare log files too
28 cd /home/playsms
29 sudo touch log/audit.log log/playsms.log
30 sudo chmod 664 log/audit.log log/playsms.log
31 sudo chown www-data.playsms -R log
32 ls -l log
33 sudo mysqladmin create playsms
34 sudo mysql
35 cd src/
36 ls
37 git clone -b 1.4.7 --depth=1 https://github.com/playsms/playsms.git
38 cd playsms/
39 ls
40 cp install.conf.dist install.conf
41 nano install.conf
42 ./install-playsms.sh
43 php -v
44 nano /var/www/html/playsms/config.php
45 sudo apt install php8.0 php8.0-cli php8.0-fpm php8.0-mysql php8.0-gd php8.0-curl php8.0-mbstring php8.0-xml php8.0-zip language-pack-id -y
46 rm -rf /var/lib/playsms
47 rm -rf /var/www/html/playsms/
48 php -v
49 ./install-playsms.sh
50 playsms
51 playsmsd
52 cd ..
53 ls
54 rm -rf playsms/
55 mysql
56 git clone -b 1.4.6 --depth=1 https://github.com/playsms/playsms.git
57 ls
58 cd playsms/
59 ls
60 cp install.conf.dist install.conf
61 nano install
62 nano install.conf
63 rm -rf /var/lib/playsms
64 rm -rf /var/www/html/playsms/
65 ./install-playsms.sh
66 nano /var/www/html/playsms/config.php
67 nano /var/www/html/playsms/plugin/gateway/jasmin/fn.php
68 certbot --nginx
69 playsmsd stataus
70 playsmsd
71 update-alternatives --config php
72 playsmsd stataus
73 playsmsd status
74 playsmsd start
75 w
76 history