Difference between revisions of "Nginx"
Line 16: | Line 16: | ||
==Configure== | ==Configure== | ||
− | link in rc7.d | + | Create a link in rc7.d This enables nginx to start on boot. |
− | + | ln -s /etc/rc.d/init.d/nginx /etc/rc.d/rc7.d/S87nginx | |
Create /var/log/nginx and set permissions if required | Create /var/log/nginx and set permissions if required | ||
Line 49: | Line 49: | ||
signal-event remoteaccess-update | signal-event remoteaccess-update | ||
+ | |||
+ | Now engine if correctly configured in the conf files will listen on 4483 | ||
+ | |||
+ | Alternatively we can set apache to private so it only listens to local/internal connectins ,and nginx to external ones. | ||
+ | |||
+ | config setprop httpd-e-smith access private | ||
+ | |||
+ | config setprop nginx TCPPort 443 | ||
+ | |||
+ | signal-event remoteaccess-update | ||
+ | |||
+ | Or if you want port 80 as well | ||
+ | |||
+ | config setprop nginx TCPPorts 80,443 | ||
+ | |||
+ | signal-event remoteaccess-update | ||
==Start== | ==Start== | ||
/etc/rc.d/init.d/nginx start | /etc/rc.d/init.d/nginx start |
Revision as of 23:37, 11 December 2018
It is possible to install nginx on SME. However, careful consideration must be given to the existing apache installation.
This is how to install on a specific port to avoid apache.
In this example we will use port 4483
Install
yum --enablerepo=epel install nginx
Configure
Create a link in rc7.d This enables nginx to start on boot.
ln -s /etc/rc.d/init.d/nginx /etc/rc.d/rc7.d/S87nginx
Create /var/log/nginx and set permissions if required
mkdir -p /var/log/nginx
Configs
e.g.
cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.con_
Now add your own configuration
e.g.
/etc/nginx/conf.d/myconf.conf
Check the port. You can use dehydrated/letsencrypt certificates
Ports
Open a port on your firewall
config set nginx service TCPPort 4483 status enabled access public
signal-event remoteaccess-update
Now engine if correctly configured in the conf files will listen on 4483
Alternatively we can set apache to private so it only listens to local/internal connectins ,and nginx to external ones.
config setprop httpd-e-smith access private
config setprop nginx TCPPort 443
signal-event remoteaccess-update
Or if you want port 80 as well
config setprop nginx TCPPorts 80,443
signal-event remoteaccess-update
Start
/etc/rc.d/init.d/nginx start