What is nginx?

Source: Internet
Author: User

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.


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.