Difference between revisions of "Nginx"
From SME Server
Jump to navigationJump to search (Page init) |
|||
Line 1: | Line 1: | ||
− | + | {{Warning box| Work in progress. Do NOT try this on a production server}} | |
+ | |||
+ | It is possible to install nginx on SME. However, careful consideration must be given to the existing apache installation. | ||
+ | |||
+ | {{Warning box|Before starting nginx you MUST decide what port to run it on and configure it accordingly}} | ||
+ | |||
+ | 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== | ||
+ | |||
+ | link in rc7.d | ||
+ | |||
+ | This enables nginx to start on boot. | ||
+ | |||
+ | Create /var/log/nginx and set permissions if required | ||
+ | |||
+ | mkdir -p /var/log/nginx | ||
+ | |||
+ | |||
+ | ===Configs=== | ||
+ | |||
+ | {{Note box|rename existing configs to config_con_ or move them completely to avoid issues}} | ||
+ | |||
+ | 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 | ||
+ | |||
+ | ==Start== | ||
+ | |||
+ | /etc/rc.d/init.d/nginx start |
Revision as of 19:17, 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
link in rc7.d
This enables nginx to start on boot.
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
Start
/etc/rc.d/init.d/nginx start