What is nginx?
Nginx and vsftpd are mainly used.
For installation, you can download it directly from the nginx official website, or...
yum install nginx
If there is no yum source, you need to add it and then install it.
yum install wgetwget http://www.atomicorp.com/installers/atomic sh ./atomic yum check update
If you download it from the official website, perform the following operations:
[root@admin local]# cd /usr/local[root@admin local]# tar -zxv -f nginx-1.6.2.tar.gz[root@admin local]# rm -rf nginx-1.6.2.tar.gz[root@admin local]# mv nginx-1.6.2 nginx[root@admin local]# cd /usr/local/nginx[root@admin nginx]# ./configure --prefix=/usr/local/nginx[root@admin nginx]# make[root@admin nginx]# make install
Install vsftpd:
yum install vsftpd
No complicated configuration is made for nginx, but a virtual directory is created and the directory browsing function is enabled.
When I want to access http: // localhost/apps, the actual access path is/home/appmanager/
First, I need to create an apps folder under nginx/html, although this path is not actually accessed.
mkdir /usr/local/nginx/html/apps
Then modify nginx/conf/nginx. conf and add a location in the default server and specify the actual path:
location /apps/ { root /home/appmanager/; #alias ; autoindex on; #autoindex_exact_size off; #autoindex_localtime on; }
Autoindex on enables browsing.
Root maps apps to/home/appmanager/apps/
Of course, alias can also achieve the desired effect, but its usage is slightly different from that of root.
Then you need to create a user, that is, the appmanager in the configuration file above.
useradd -d /home/appmanager -M appmanager
Specify the Directory and add permissions
chown appmanager /home/appmanagerchmod 777 -R /home/appmanager
For some reason, the Directory of the user I created for the first time always does not take effect, even though multiple times of usermod-d does not work ....
In any case, you can access it through the Jsch api.
public static void main(String[] args) throws JSchException { Session session = null; ChannelSftp channelSftp = null; try { JSch.setLogger(new JSCHLogger()); JSch jsch = new JSch(); session = jsch.getSession("appmanager", "101.x.x.x", "22"); session.setPassword("password"); Properties config = new Properties(); config.put("StrictHostKeyChecking", "no"); session.setConfig(config); session.connect(); channelSftp = (ChannelSftp) session.openChannel("sftp"); channelSftp.connect(); } catch (JSchException | SftpException | IOException e) { logger.error(e.getMessage(), e); } finally { if (channelSftp != null) { channelSftp.disconnect(); } if (session != null) session.disconnect(); }}
How does one make an error during nginx installation?
The last two. Remove the last one.
How does one make an error during nginx installation?
The last two. Remove the last one.