in This Tutorial you will learn " How To Deploy Solidjs/solid With Nginx On Rocky Linux 8.5"
Solid is a fast, declarative JavaScript library for creating user interfaces in web applications.
Nginx (pronounced engine x) is open source Web server software that also performs reverse proxy, load balancing, email proxy and HTTP cache services.
Homepage - https://www.solidjs.com/ | Gihtub :- https://github.com/solidjs/solid
Guide - https://www.solidjs.com/guides/getting-started
_________________________________________________________________________________________
Server - Os: Rocky Linux 8.5 64Bit | IP -192.168.1.60 |Hostname - server.yourdomain.com
_________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf module enable nodejs:14 -y ; dnf install nodejs npm -y
npx degit solidjs/templates/js my-app
cd my-app
npm i
npm run dev
http://localhost:3001/
cat << EOF > /lib/systemd/system/solidjs.service
[Unit]
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/my-app
ExecStart=/usr/bin/npm run dev
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload ; systemctl start solidjs ; systemctl enable solidjs ; systemctl status solidjs
dnf makecache ; dnf install @nginx -y
nano /etc/nginx/conf.d/example.com.conf
server {
listen 80;
server_name www.yourdomain.com;
location / {
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:3000;
}
}
systemctl restart nginx ; firewall-cmd --permanent --add-service={http,https} ; firewall-cmd --reload
echo "192.168.1.60 www.yourdomain.com" >> /etc/hosts
www.yourdomain.com
---------------------------------------------------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment