搬瓦工 VPS推荐

搬瓦工因其官网网站标识是BandwagonHost有点类似BanWaGong的拼写所以我们国内的站长喜欢称作为搬瓦工VPS搬瓦工VPS是一款性价比较高的便宜VPS主机且适合入门级网友学习Linux和建站用途
搬瓦工VPS隶属于美国IT7公司旗下的一款低价OpenVZ VPS主机方案、2017年新增KVM VPS架构.

  • 搬瓦工优惠码BWHCGLUKKB
CN2 GIA-E (推荐)
  • 2核 CPU
  • 1GB memory
  • 20GB SSD 硬盘
  • 1000GB 月流量
  • 2.5Gbps 带宽
  • DC6/DC9/软银/荷兰
  • $49.99/季度,$169.99/year
  • 最推荐三网直连速度超快

立即下单

 

HK (高端)

  • 2核 CPU
  • 2GB memory
  • 40GB SSD 硬盘
  • 500GB 月流量
  • 1Gbps 带宽
  • 香港 CN2 GIA 机房
  • $89.99/month,$899.99/year
  • 土豪高端选择绝对好用

立即下单

Comments off

apache 2.4 Version get real ip

apache 2.4 version has been added by default mod_remoteip ,Check the configuration if found not resolve deleted,please delete#.

1.The following added to the apache configuration in the rearmost:

RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy 127.0.0.1/24
#CloudFlare IP Ranges
RemoteIPInternalProxy 103.21.244.0/22
RemoteIPInternalProxy 103.22.200.0/22
RemoteIPInternalProxy 103.31.4.0/22
RemoteIPInternalProxy 104.16.0.0/12
RemoteIPInternalProxy 108.162.192.0/18
RemoteIPInternalProxy 131.0.72.0/22
RemoteIPInternalProxy 141.101.64.0/18
RemoteIPInternalProxy 162.158.0.0/15
RemoteIPInternalProxy 172.64.0.0/13
RemoteIPInternalProxy 173.245.48.0/20
RemoteIPInternalProxy 188.114.96.0/20
RemoteIPInternalProxy 190.93.240.0/20
RemoteIPInternalProxy 197.234.240.0/22
RemoteIPInternalProxy 198.41.128.0/17 #CDN of your IP,Can be repeated to add

2.Modify the configuration information below

  1. #Modify log format,Plus the log format%a,Then you can restart apache:
  2. LogFormat “%h %a %l %u %t ”%r” %>s %b ”%{Referer}i” \”%{User-Agent}i”” combined
  3. LogFormat “%h %a %l %u %t ”%r” %>s %b ” common
  4. LogFormat “%h %l %u %t \”%r” %>s %b ”%{Referer}i” \”%{User-Agent}i” %I% O” combined

Comments off

cpanel using third-party SSL(letsencrypt)Unofficial plug-ins

Plug it seems to look at the details of the official fee,We only for testing, please visithttps://letsencrypt-for-cpanel.com/pricing Site description is a trial 72 hours,It can also be issued after 72 hours you can try.

Third-party SSL connection installation tutorial https://letsencrypt-for-cpanel.com/docs/for-admins/installation/

1.Increase the installation source

wget https://cpanel.fleetssl.com/static/letsencrypt.repo -O /etc/yum.repos.d/letsencrypt.repo

2.Install the software update

yum -y install letsencrypt-cpanel

3.After installing the self-test

le-cp self-test

The following is the implementation process

[root@ireland ~]# yum -y install letsencrypt-cpanel Loaded plugins: fastestmirror, universal-hooks Loading mirror speeds from cached hostfile * EA4: 91.197.228.252 * cpanel-addons-production-feed: 91.197.228.252 * cpanel-plugins: 91.197.228.252 * base: ftp.tsukuba.wide.ad.jp * extras: ftp.tsukuba.wide.ad.jp * updates: ftp.tsukuba.wide.ad.jp EA4 | 2.9 kB 00:00:00 cpanel-addons-production-feed | 2.9 kB 00:00:00 cpanel-plugins | 2.9 kB 00:00:00 base | 3.6 kB 00:00:00 extras | 2.9 kB 00:00:00 letsencrypt-cpanel | 2.9 kB 00:00:00 mysql-connectors-community | 2.5 kB 00:00:00 mysql-tools-community | 2.5 kB 00:00:00 mysql57-community | 2.5 kB 00:00:00 updates | 2.9 kB 00:00:00 (1/2): letsencrypt-cpanel/primary_db | 5.7 kB 00:00:00 (2/2): cpanel-plugins/x86_64/primary_db | 30 kB 00:00:00 Resolving Dependencies –> Running transaction check —> Package letsencrypt-cpanel.x86_64 0:0.15.1-1 will be installed –> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================================================================================================================= Installing: letsencrypt-cpanel x86_64 0.15.1-1 letsencrypt-cpanel 5.1 M Transaction Summary ============================================================================================================================================================================================================================================================= Install 1 Package Total download size: 5.1 M Installed size: 14 M Downloading packages: letsencrypt-cpanel-0.15.1-1.x86_64.rpm | 5.1 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction *** By running this installer, you indicate that you have read the end-user licence agreement (https://cpanel.fleetssl.com/eula) and agree to all of its terms, as stated. *** Running installer as root OS version OK cPanel version OK No licence file detected at /etc/letsencrypt-cpanel.licence Fetching new trial licence … Licence file present Redirecting to /bin/systemctl stop letsencrypt-cpanel.service Failed to stop letsencrypt-cpanel.service: Unit letsencrypt-cpanel.service not loaded. FleetSSL cPanel service daemon stopped Installing : letsencrypt-cpanel-0.15.1-1.x86_64 1/1 This server has self-signed service certificates It is not safe to operate this plugin in this circumstance ‘insecure’ is being added to /etc/letsencrypt-cpanel.conf If you wish to generate a Let’s Encrypt cert for the server Please read the configuration documentation on our website, at https://cpanel.fleetssl.com/docs/service-certificates/ Config written to /etc/letsencrypt-cpanel.conf Uninstallation of existing service failed (it’s OK) Installed init scripts. Copied plugin files OK Installing cPanel paper_lantern plugin (may take a minute) … cPanel Plugin installer succeeded OK Installed chkservd scripts Added apache pre virtualhost global include Set cpanel tweak settings — Installation complete — The plugin should now be available in the cPanel feature manager Will rebuild conf and restart Apache to reload AutoSSL DCV URLs Rebuilding Apache conf and restarting now … Built /etc/apache2/conf/httpd.conf OK Verifying : letsencrypt-cpanel-0.15.1-1.x86_64 1/1 Installed: letsencrypt-cpanel.x86_64 0:0.15.1-1 Complete! [root@ireland ~]# le-cp self-test [SELF-TEST] Has valid licence ………… SUCCESS. [SELF-TEST] Can read config ………… SUCCESS. [SELF-TEST] Can connect to Let’s Encrypt ………… SUCCESS. [SELF-TEST] Can talk to WHM API ………… SUCCESS. [SELF-TEST] Can talk to plugin RPC ………… SUCCESS. [SELF-TEST] System tuning correctness ………… SUCCESS. [root@ireland ~]#

 

5.Here is the method https://letsencrypt-for-cpanel.com/docs/for-admins/autossl/

1.About automatic issuance( AutoSSL )

The plugin can provide "AutoSSL" type of function。

Disabled by default。

If you enable,It every 12 hours (after the renewal processing is completed):

  • Find a web hosting meets the following criteria
  • No valid certificate (not self-signed and has not expired within the next 48 hours)
  • All collected by the DCV (domain control validation) checks domain,And add a certificate to all domain by plug-ins
  • DCV failed field will be automatically skipped
  • Exceeds "Encryption" certificate rate limit (i.e., the name of each certificate 100+)
  • Repeated failure of the domain will eventually cease to retry,But always send them via UI.

Enable / Disable

 

启用(推荐)
[root@~]$ le-cp autossl enable
禁用
[root@~]$ le-cp autossl disable

5.Issued manually(If you find that the certificate expired,First of all to remove the certificate

(Home »SSL/TLS »Manage SSL Hosts

6.Then use the command issued to SSH:

le-cp ssl --user=用户名  issue abc.com www.abc.com
成功例子:
[root@ireland ~]# le-cp ssl --user=drma**** issue drmartens*******.fi www.drmartens*******.fi
INFO[0011] 1 certificates were returned
INFO[0011] Domain: drmartens*******.fi
INFO[0011]      Requested AltNames: [drmartens*******.fi www.drmartens*******.fi]
INFO[0011]      Expiry: 2020-05-12 21:49:45 -0400 EDT
INFO[0011]      URL: https://acme-v02.api.letsencrypt.org/acme/order/78038503/2315490342
INFO[0011]      Cert ID: drmartens*******_fi_d2ae8_3e4c3_1589334585_c28571a4e7223c826fa6ba29749bb59a
INFO[0011]      Key ID: d2ae8_3e4c3_73dbff3b435eb636c6faf1f391287465
INFO[0011]      Actual DNS Names on Certificate: [drmartens*******.fi www.drmartens*******.fi]

Comments off

The maximum number of connections is too large,Causes SSH to fail to log in

pam_limits(login:session): Could not set limit for ‘nofile’: Operation not permitted

COULD NOT SET LIMIT FOR ‘NOFILE’: How to deal with OPERATION NOT PERMITTED

If you need to allow users to use large file resources, you need to modify the kernel's file resource limit first
Modify the number of files that the user can open generally directly modify the nofile of limits.conf,However, if you modify this value to millions, it is likely that ssh cannot be logged in.、System abnormal
Because it is very likely that the number of files that can be opened by the user exceeds the number of files that can be opened by the kernel
The correct modification method is as follows:
Modify the number of files that can be opened by the kernel first,Modify the number of files that the user can open
The specific location of the kernel limit is:
/proc/sys/fs/file-max-the number of files that can be opened by all processes at the system level
/proc/sys/fs/nr_open-defines the maximum allowable modification of file-max,file-max cannot exceed this value
Modify /etc/sysctl.conf to increase:
fs.file-max =***
fs.nr_open = ***
You can modify the configuration of the kernel
After modification,Then modify /etc/security/limits.conf
* soft nofile *** * hard nofile ***
Also change here /etc/security/limits.d/90-nproc.conf

Comments off

Protected: cpanel Merge User

This content is password protected. To view it please enter your password below:

Comments off

cpanel users to create multiple websites

Use a user multiple Web sites to give you first assign domain user rights:

Create packages package

resource allocation,Then ADD.

Multi-user editing


After entering a user selected,Or select a plurality of users. Pulled the bottom:
Distributed packages package
First, we close some dns detection function NS,DNS server can not be prevented without the use of additional domain name.

Finished modifying the above,Then into cpanel sub users,That is https://ip:2083port.

Add new domains
The above is a demo,Replace your own domain name.
After completion of the above,Get details.

Then we try to upload a file,Open File Manager.

Add the domain name path

Comments off

php

DSO

It is also known as mod_php.  It is the fastest way to serve the PHP requests. It runs PHP directly from the Apache without working like a separate service. The PHP scripts will run as the Apache user, which by default is the user ‘nobody’. In this case the PHP scripts all are owned & executed by the Apaches’s ‘nobody’ user. Therefore, we cannot track each individual user since they all run from one web server.  Security is another concern in DSO mode. It is vulnerable to malicious attacks that could modify your PHP scripts or modify the files outside of that user’s directory that had the PHP script that were exploitable. The benefit of the DSO handler is that it provides PHP opcode caching along with DSO to speed up the PHP requests. Also, we can set PHP directives directly via .htaccess files to control certain functionality of PHP.

You might choose DSO as your PHP handler if you only have one user and your primary concern is speed and performance.

CGI

CGI handler will run PHP as a CGI module as opposed to an Apache module. The CGI method is intended as a fallback handler for when DSO is not available. This method is neither fast nor secure. That is regardless of whether or not suEXEC is enabled. Nowadays, CGI handlers are used less frequently because of other handler benefits. Similar to suPHP and FastCGI, the CGI handler can use suEXEC. Instead, PHP executions are run by the file owner of a PHP script rather than the Apache “nobody” user. The usage of CGI handlers provides ease of configuration and support using suEXEC for reducing permission related issue. The main disadvantage of the CGI handler is that it is one of the slowest handler. The CGI handler is the least popular for this reason leading it to be one of the less frequently used handlers

CGI is a recommended PHP handler if suPHP, DSO, or FastCGI was not available in your server.

suPHP

Technically it is a CGI module, but it is entirely different from the CGI handler. It is the most flexible and secure way of serving PHP requests. The main advantage with this handler is it runs the PHP script as the user calling them, instead the ‘nobody’ user. Also, it is quite easy to monitor the usage of PHP script executions, because for every PHP request that is being processed a separate PHP process will be generated. Another advantage is that suPHP handler isolates one of the user on the server from others. This is a precaution taken because if one user’s account is misused then the attacker would only be able to view or modify files owned by that particular users. These applications require permission to have the ability to write, modify, and create files on the server. Permission management is easy to configure because all of your files are owned by just one user.

The main disadvantage of suPHP is speed and CPU load. This handler is recommended for small reseller clients, because it possess the high load of running separate PHP process per request. Also, if the server receives high amount of PHP requests in small period of time, this can result in a heavy load on your server.

The selection of suPHP as your PHP handler is recommended if you have multiple users on your server. You do not want to worry about setting permissions, and you are not having any performance issues with the PHP scripts that is currently used.

Fast CGI

FastCGI PHP handler is a faster way to serve PHP requests than using suPHP, but typically not as fast as using DSO. FastCGI helps reduce CPU usage by increasing the server’s available RAM in order to cache PHP scripts in the memory. This method is use instead of starting up a separate PHP process for each and every PHP request.

The main benefit of using FastCGI is that you can you can use suEXEC just like in the suPHP. This allows the PHP scripts to be executed by the actual user of the PHP script instead of the Apache’s ‘nobody’ user. It also does not require a single PHP process execution per request like suPHP does, which enhances the speed and the CPU usage by keeping PHP scripts in the memory. Issue regarding the memory usage is the drawback of FastCGI.  Also regarding the PHP opcode cache, itt keeps PHP sessions opened in the background in memory for faster access

FastCGI is the best handler if you are looking for a faster PHP execution, provided that you the high availability of memory to spare on your server.

Comments off

Romania


美国服务器

 

 

E3-12xx / 32GB memory / 1TB SSD / 5个IP可用 1312.5元

Comments off

Protected: monitor

This content is password protected. To view it please enter your password below:

Comments off

ovz source

yum remove -y kernel-firmware-2.6.32-696.30.1.el6.noarch
wget ie.archive.ubuntu.com/centos/6/cr/x86_64/Packages/kernel-firmware-2.6.32-754.el6.noarch.rpm

rpm -ivh kernel-firmware-2.6.32-754.el6.noarch.rpm

Comments off

Protected: win7 key

This content is password protected. To view it please enter your password below:

Comments off

Linux continuously execute multiple commands

Had previously been using a "shell + expect" combination。

Later in the course of,Expect more and more that this stuff is too far behind,The following reasons:

1. It has stopped issuing new official version;

2. Debug inefficient,In many cases the code to go with the way people think Mom。

then,It was later decided to use a scripting language python all done。

Practice has proved that,python development efficiency is very high,Indeed "rough fast fierce"。

stop,Digress。。。

In my Automation case in,You need to check whether a command is executed successfully (assuming command checklog,Successful return 0,Failure to return 1)。

Under normal circumstances,In the next sentence checklog,Direct "echo $?”,Judgment 0,1To。

but,Because the execution environment of the command prompt, 0 and 1,So pexpect not judge "echo $?"the result of。

later,Wondering wondering,My mind just emerge above knowledge points,I tried it,Fix the problem it is hereby Mark。

# Checklog expect the successful implementation
checklog && echo success
pexpect.expect(‘success’)

# Checklog execution failed expectations
checklog || echo failure
pexpect.expect(‘failure’)

Brush up the knowledge:
1. Command is the semicolon ";"Separated,These commands will be executed sequentially down;
2. Command is "&&"Separated,These commands will be executed sequentially down,Stop command execution encountered an error;
3. Commands are double pipe "||"Separated,These commands will be executed sequentially down,Stop command is successful encounter,All commands will not be executed later;

Comments off

linux network speed test

wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest.py
./speedtest.py
Show
root@cn2:~# ./speedtest.py
Retrieving speedtest.net configuration…
Testing from QuadraNet (104.129.8.16)…
Retrieving speedtest.net server list…
Selecting best server based on ping…
Hosted by Interoute VDC (The Angels, THAT) [1.30 km]: 1.825 ms
Testing download speed…………………………………………………………………….. Downstream
Download: 97.70 Mbit/s
Testing upload speed…………………………………………………………………………………… Uplink
Upload: 94.82 Mbit/s

Comments off

semget: No space left on device DA can not start apache

This relates to semaphores on your system (you’ve run out). Run the following to clear them out:

ipcs | grep apache | awk ‘{print $2}’ > sem.txt
for i in `cat sem.txt`; do { ipcrm -s $i; }; done;

If this becomes a common occurance, then you may need to change your ipcs semaphore limits.
Set the following in your /etc/sysctl.conf:

kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024

and reboot your system to load in those values.

Comments off

Protected: Screen some ip

This content is password protected. To view it please enter your password below:

Comments off

« Previous entries Next Page » Next Page »