Nodejs for CentOS Configuration

Source: Internet
Author: User

Nodejs

http://zhaohe162.blog.163.com/blog/static/38216797201402234212981/


Mem

http://blog.csdn.net/yybjroam05/article/details/8651789


Memcached-d-P 11212-u memcached-m 64-c 1024-p/var/run/memcached/memcached.pid
Memcached-d-P 11213-u memcached-m 64-c 1024-p/var/run/memcached/memcached.pid


Nginx

Http://www.cnblogs.com/zhoulf/archive/2013/02/09/2909653.html

Mysql
Http://www.2cto.com/database/201305/208114.html

Modify password refresh permissions and restart MySQL
Update user set Password=password (' own password ') where user= ' root ';
Flush privileges;
Service mysqld Restart;

Delete anonymous user

After MySQL has just been installed, there is a user name, password is empty user. This allows the database server to have the possibility of no password being logged in. To eliminate the risk, delete the anonymous user.

[[email protected] ~]# mysql-u root-p← login with root by password
Enter password:← the password here

Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 7 to server version:4.1.20
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the buffer.
Mysql> select User,host from Mysql.user; ← Viewing user Information
+------+----------------------------+ www.2cto.com
| user | Host |
+------+----------------------------+
| | localhost |
| Root | localhost |
| | sample.centospub.com |
| Root | sample.centospub.com |
+------+----------------------------+
4 rows in Set (0.02 sec)
Mysql> Delete from mysql.user where user= '; ← Deleting anonymous users
Query OK, 2 rows affected (0.17 sec)
Mysql> select User,host from Mysql.user; ← Viewing user Information
+------+----------------------------+
| user | Host |
+------+----------------------------+
| Root | localhost |
| Root | sample.centospub.com |
+------+----------------------------+


http://blog.163.com/chengwei_1104/blog/static/53645274201271684740219/
Open MySQL remote connection under CentOS, remote Management database

2012-08-16 08:47:40| Category: MySQL | report | Font Subscription
When the server is not running PHP, not installed phpMyAdmin, remote management of MySQL is necessary. Because it is set under CentOS, the title is added to CentOS, and the following commands should be OK under the Debian system.

Mysql-u root-p MySQL # 1th MySQL is the execution command, and the 2nd MySQL is the system data name
In the MySQL console perform:

Grant all privileges on * * to ' root ' @ '% ' identified by ' telnet password, can be different from local ' with GRANT option;
# root is user name,% for any host, ' 123456 ' specified login password (this and local root password can be set differently, not affect each other)
Flush privileges; # Overloaded System permissions
Exit
Allow Port 3306

Iptables-i input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT
# See if the rules are in effect
Iptables-l-N # or: Service iptables status

# The production environment is not secure at this time, the port should be closed after remote management, and the previously added rules should be removed
iptables-d input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT
PS, above iptables Add/Remove rules are temporary, if you need to restart after the effective, you need to save the changes:
Service Iptables Save # or:/etc/init.d/iptables save
Other than that
Vi/etc/sysconfig/iptables # plus the following line of rules is OK
-A input-p tcp-m state--state new-m TCP--dport 3306-j ACCEPT

Remote management of the database software, win system can use SQLyog, with several remote software, feel this use is pretty good.


Webmin
Root
System Password

The server is multi-network card, find the network port of the public network. Use-I [Port_name] configuration allows access to tcp:22 and tcp:1521; Other protocols and ports are denied by default.
Iptables-a input-i eth1-p TCP--dport 22-j ACCEPT
Iptables-a input-i eth1-p TCP--dport 80-j ACCEPT
Iptables-a input-i eth1-p TCP--dport 10000-j ACCEPT
Iptables-a input-i eth1-j DROP
Run/etc/rc.d/init.d/iptables save config file to/etc/sysconfig/iptables

The rule is still valid after you run the service iptables restart confirm the restart Iptables.

The following is the Nginx configuration file has been opened SSL


#user nobody;
Worker_processes 1;

#error_log Logs/error.log;
#error_log Logs/error.log Notice;
#error_log Logs/error.log Info;

#pid Logs/nginx.pid;


Events {
Worker_connections 1024;
}


HTTP {
Include Mime.types;
Default_type Application/octet-stream;

#log_format Main ' $remote _addr-$remote _user [$time _local] "$request" '
# ' $status $body _bytes_sent ' $http _referer '
# ' "$http _user_agent" "$http _x_forwarded_for" ';

#access_log Logs/access.log Main;

Sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
Keepalive_timeout 65;

#gzip on;

server {
Listen 80;
server_name localhost;

#charset Koi8-r;

#access_log Logs/host.access.log Main;

Location/{
root HTML;
Index index.html index.htm;
#20141012add
#proxy_set_header X-real-ip $remote _addr;
#proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
#proxy_set_header Host $http _host;
#proxy_set_header X-nginx-proxy true;
Proxy_pass http://localhost:3000/;
#proxy_redirect off;
}

#error_page 404/404.html;

# REDIRECT Server error pages to the static page/50x.html
#
Error_page 502 503 504/50x.html;
Location =/50x.html {
root HTML;
}

# Proxy The PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# Proxy_pass http://127.0.0.1;
#}

# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root HTML;
# Fastcgi_pass 127.0.0.1:9000;
# Fastcgi_index index.php;
# Fastcgi_param Script_filename/scripts$fastcgi_script_name;
# include Fastcgi_params;
#}

# Deny access to. htaccess files, if Apache ' s document Root
# concurs with Nginx ' s one
#
#location ~/\.ht {
# Deny All;
#}
}


# Another virtual host using mix of ip-, name-, and port-based configuration
#
#server {
# Listen 8000;
# Listen somename:8080;
# server_name somename alias Another.alias;

# location/{
# root HTML;
# index index.html index.htm;
# }
#}


# HTTPS Server
#
server {
Listen 443 SSL;
server_name localhost;

SSL_CERTIFICATE/ROOT/PROJECT/CLOUD/SSL-CRT.PEM;
Ssl_certificate_key/root/project/cloud/ssl-key.unsecure;

Ssl_session_cache shared:ssl:1m;
Ssl_session_timeout 5m;

Ssl_ciphers high:!anull:! MD5;
Ssl_prefer_server_ciphers on;

Location/{
root HTML;
Index index.html index.htm;
Proxy_pass http://localhost:3001/;
}
}

}

Nodejs for CentOS Configuration

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.