From 3bd45b33fc0521451e8ec73eda2521ca63421590 Mon Sep 17 00:00:00 2001 From: "491586629@qq.com" <491586629@qq.com> Date: Sat, 26 Apr 2014 11:37:30 +0800 Subject: [PATCH 1/3] translated --- ...FPM with mod proxy fcgi on Ubuntu 13.10.md | 2 +- ...o Check If Linux OS is 32 bit or 64 Bit.md | 72 ------------------- 2 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 sources/tech/5 Ways To Check If Linux OS is 32 bit or 64 Bit.md diff --git a/sources/Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md b/sources/Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md index 553f1a7f55..1ae4171e86 100644 --- a/sources/Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md +++ b/sources/Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md @@ -1,7 +1,7 @@ 没人领我就继续做吧 Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10 ================================================================================ -### mod_proxy_fcgi ### +### mod\_proxy\_fcgi ### The module mod_proxy_fcgi is a new one and it allows apache to connect to/forward requests to an external fastcgi process manager like php fpm. This allows for a complete separation between the running of php scripts and Apache. Earlier we had to use modules like mod_fcgid and mod_fastcgi which all had some limitations. Mod_fcgid for example did not properly utilise the process management capability of php-cgi whereas mod_fastcgi is a third party module. diff --git a/sources/tech/5 Ways To Check If Linux OS is 32 bit or 64 Bit.md b/sources/tech/5 Ways To Check If Linux OS is 32 bit or 64 Bit.md deleted file mode 100644 index d3054fec09..0000000000 --- a/sources/tech/5 Ways To Check If Linux OS is 32 bit or 64 Bit.md +++ /dev/null @@ -1,72 +0,0 @@ -crowner 验尸中 -5 Ways To Check If Linux OS is 32 bit or 64 Bit -================================================================================ -Sometimes Linux newbies get confused while downloading a software because the download page offers them both 32 bit and 64 bit versions of the same software. It is important to know whether your Linux OS is 32-bit or 64-bit, as this information is required while doing various tasks. In this article, we will discuss five different ways to check if your Linux OS is 32-bit or 64-Bit. - -### Check If Linux is 32-bit or 64-Bit ### - -Please note that the methods mentioned in this article are tested on Ubuntu 13.10. - -#### 1. Execute the ‘uname -a’ command #### - -One of the most common way to check if your Linux OS is 32 bit or 64 Bit is by running the [uname command][1]. - -For example, on my system, it displayed the following information: - - $ uname -a - Linux ubuntu 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 athlon i686 GNU/Linux - -The highlighted **i686** (or i386 in some cases) signifies that the operating system is 32 bit, but if **x86_64** appears, then it means that the OS is 64 bit. - -#### 2. Execute the ‘uname -m’ command #### - -A similar but slightly different way is to run the ‘uname -m’ command. - -For example, on my system, it displayed the following information: - - $ uname -m - i686 - -Which means that my Ubuntu Linux is 32-bit. If it would have been 64 bit, the output would have been x86_64. - -#### 3. Using the file command #### - -Although it’s a kind of hack, but still it can be used to solve the purpose. In this case, you have run the file command with **/sbin/init** as an argument. - -Here is an example : - - $ file /sbin/init - /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xc0d86a25a7abb14cad4a65a1f7d03605bcbd41f6, stripped - -The highlighted 32-bit signifies a 32-bit OS, and vice-versa. - -#### 4. Using the arch command #### - -Another alternative is to use the arch command, which prints the machine hardware name. - -Here is an example: - - $ arch - i686 - -So you can see that the output was i686, which signifies a 32-bit OS. For a 64-bit OS, the output would have been x86_64. - -#### 5. Through system settings #### - -If you are using Ubuntu 12.04 or higher, you can easily check your OS architecture by going to All **Settings -> Details**. - -![details](http://mylinuxbook.com/wp-content/uploads/2014/04/details.png) - -So you can see that the OS type (32-bit) is clearly mentioned here. - -Do you know other ways to check if Linux OS is 32 bit or 64 Bit? Share your ideas in comments - --------------------------------------------------------------------------------- - -via: http://mylinuxbook.com/5-ways-to-check-if-linux-is-32-bit-or-64-bit/ - -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://mylinuxbook.com/linux-uname-command/ \ No newline at end of file From d50f77597ba18d71b365cda6303b8e46ffce2b43 Mon Sep 17 00:00:00 2001 From: "491586629@qq.com" <491586629@qq.com> Date: Sat, 26 Apr 2014 11:42:33 +0800 Subject: [PATCH 2/3] translated --- ...o Check If Linux OS is 32 bit or 64 Bit.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 translated/tech/5 Ways To Check If Linux OS is 32 bit or 64 Bit.md diff --git a/translated/tech/5 Ways To Check If Linux OS is 32 bit or 64 Bit.md b/translated/tech/5 Ways To Check If Linux OS is 32 bit or 64 Bit.md new file mode 100644 index 0000000000..1eb25af1aa --- /dev/null +++ b/translated/tech/5 Ways To Check If Linux OS is 32 bit or 64 Bit.md @@ -0,0 +1,71 @@ +五种检测你的 Linux 是32位或者64位的方法 +================================================================================ +有的时候 Linux 新手们在下载的时候十分困惑,因为下载页面常常同时提供32位和64位的版本的软件。弄清楚你的操作系统是32位的或者64位的十分重要,因为你在做很多事情的时候都需要这个信息。在这篇文章里,我们会讨论五种检测你的Linux系统是32位或者64位的方法。 + +### 检测你的 Linux 是32位或64位的 ### + +请注意文中的这些方法仅经过 Ubuntu 13.10 平台测试. + +#### 1. 执行‘uname -a’ 命令 #### + +最常见的一个测试你的Linux是32位或者64位的方法是运行 [uname command][1] 命令。 + +例如,在我的系统里,它展示了以下信息: + + + $ uname -a + Linux ubuntu 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 athlon i686 GNU/Linux + +那个高亮的 **i686** (or 有时候会是i386) 说明操作系统是32位的,但是如果显示的是 **x86_64**,那就说明这个操作系统是64位的。 + +#### 2.运行 ‘uname -m’ 命令 #### + +一个很相似但是略有不同的方法是执行 ‘uname -m’ 命令。 + +例如,在我的系统里,它显示了以下信息: + + $ uname -m + i686 + +这说明我的 Ubuntu Linux 系统是32位的,如果输出显示的是x86\_64的话,就说明你的系统是64位的。 + +#### 3.使用 file 命令#### + +(Although it’s a kind of hack)尽管这是一种黑客式的行为,但是仍然不失为一种达到目的的方法。使用这个方法,需要你运行file命令并带上**/sbin/init**作为参数。 but still it can be used to solve the purpose. In this case, you have run the file command with as an argument. + +请看这里有一个例子 : + + $ file /sbin/init + /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xc0d86a25a7abb14cad4a65a1f7d03605bcbd41f6, stripped + +高亮的部分说明这是一个32位的操作系统,反之亦然。(and vice-versa.请定夺) + +#### 4. 使用 arch 命令 #### +另外一个可以选择的方法是使用 arch 命令,这个命令用于打印机器的硬件名称。 + +这里有一个示例: + + $ arch + i686 + +在这里你可以看到输出的是 i686, 这说明这是一个32位操作系统,对于64位的操作系统,输出的应该是x86_64。 + +#### 5. Through system settings #### + +如果你是用的是 Ubuntu 12.04 或更高, 你可以很简单的的在** AllSettings -> Details**里查看你的系统的结构。 + +![details](http://mylinuxbook.com/wp-content/uploads/2014/04/details.png) + +这样你就可以清晰的看到系统的类型(32-bit)在这里清晰的展示了出来。 + +你还知道别的方法来检测操作系统是32位还是64位的吗?请拿出你的知识在下面和大家分享吧。 + +-------------------------------------------------------------------------------- + +via: http://mylinuxbook.com/5-ways-to-check-if-linux-is-32-bit-or-64-bit/ + +译者:[crowner](https://github.com/crowner) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://mylinuxbook.com/linux-uname-command/ \ No newline at end of file From 320cda1968418244960bb9f1444a42a6e5dddd32 Mon Sep 17 00:00:00 2001 From: crowner Date: Sun, 27 Apr 2014 07:53:21 +0800 Subject: [PATCH 3/3] Delete Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md --- ...FPM with mod proxy fcgi on Ubuntu 13.10.md | 209 ------------------ 1 file changed, 209 deletions(-) delete mode 100644 sources/Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md diff --git a/sources/Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md b/sources/Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md deleted file mode 100644 index 1ae4171e86..0000000000 --- a/sources/Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10.md +++ /dev/null @@ -1,209 +0,0 @@ -没人领我就继续做吧 -Setup Apache 2.4 and Php FPM with mod proxy fcgi on Ubuntu 13.10 -================================================================================ -### mod\_proxy\_fcgi ### - -The module mod_proxy_fcgi is a new one and it allows apache to connect to/forward requests to an external fastcgi process manager like php fpm. This allows for a complete separation between the running of php scripts and Apache. Earlier we had to use modules like mod_fcgid and mod_fastcgi which all had some limitations. Mod_fcgid for example did not properly utilise the process management capability of php-cgi whereas mod_fastcgi is a third party module. - -With the arrival of mod_proxy_fcgi Apache finally gets the ability to neatly talk to external fastcgi process managers making it more efficient at the task. Delegating php requests to external fpm servers greatly reduces the load on web servers like apache resulting into efficient utilisation of machine resources and faster processing speed for users on the other end. Along with all that, php fpm can run opcode caching engines like apc in a very stable manner. - -So in this post, our task is to setup apache + php-fpm using the mod_proxy_fcgi connector. - -### 1. Setup Apache ### - -Ubuntu 13.10 already ships with apache 2.4 so all installables are in the repository itself. - -Install Apache if not already done - - $ sudo apt-get install apache2 - -Enable mod_proxy_fcgi - - $ sudo a2enmod proxy_fcgi - Considering dependency proxy for proxy_fcgi: - Enabling module proxy. - Enabling module proxy_fcgi. - To activate the new configuration, you need to run: - service apache2 restart - -Restart Apache - - $ sudo service apache2 restart - -### Configure virtual host ### - -Next task is to configure a vhost to use mod fcgi proxy to communicate with fpm. The vhost configuration files are stored in the following location - - /etc/apache2/sites-available - -Get inside there any create your new vhost configuration file by copying the 000-default.conf file which comes with apache. - - $ cd /etc/apache2/sites-available - $ sudo cp 000-default.conf mysite.conf - $ sudo nano mysite.conf - -Now its time to configure the virtualhost. Here is how I configured the file - -> -> # The ServerName directive sets the request scheme, hostname and port that -> # the server uses to identify itself. This is used when creating -> # redirection URLs. In the context of virtual hosts, the ServerName -> # specifies what hostname must appear in the request's Host: header to -> # match this virtual host. For the default virtual host (this file) this -> # value is not decisive as it is used as a last resort host regardless. -> # However, you must set it for any further virtual host explicitly. -> -> ServerName fpm.localhost -> -> ServerAdmin webmaster@localhost -> DocumentRoot /var/www/mysite -> -> # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, -> # error, crit, alert, emerg. -> # It is also possible to configure the loglevel for particular -> # modules, e.g. -> #LogLevel info ssl:warn -> -> ErrorLog ${APACHE_LOG_DIR}/error.log -> CustomLog ${APACHE_LOG_DIR}/access.log combined -> -> # For most configuration files from conf-available/, which are -> # enabled or disabled at a global level, it is possible to -> # include a line for only one particular virtual host. For example the -> # following line enables the CGI configuration for this host only -> # after it has been globally disabled with "a2disconf". -> #Include conf-available/serve-cgi-bin.conf -> -> ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/mysite/$1 -> -> -> Order allow,deny -> Allow from all -> AllowOverride FileInfo All -> # New directive needed in Apache 2.4.3: -> Require all granted -> -> -> - -The important things to note are : - -1. **ServerName** - This is the domain or the subdomain of your vhost. In this example I used fpm.localhost so that when using that sub domain on localhost, php fpm is used. Its just an example. - -2. **DocumentRoot** - This is the root of this vhost from where the web files shall be served. - -3. **ProxyPassMatch** - This is the directive that tells forward all requests for ".php" files to fcgi server at 127.0.0.1:9000. This is where our php fpm process manager would be running. More on this in the next section. -The fcgi url must contain the exact path to the document root. Otherwise it would say "File Not Found" when requesting for files. - -> ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/mysite/$1 - -The first parameter is the pattern to match. So all urls that have a ".php" in them followed by an option slash and anything else are matched and the matched part is forwarded to the fcgi server running at 127.0.0.1:9000. - -4. **Require all granted** - After the ProxyPassMatch line we added a section with Require and AllowOverride directives. It is necessary as of Apache 2.4 - -Save the file and enable it using the a2ensite command which saves the effort to create the symlink in sites-enabled directory. - - $ sudo a2ensite mysite - Enabling site mysite. - To activate the new configuration, you need to run: - service apache2 reload - -Now reload apache configuration - - $ sudo service apache2 reload - * Reloading web server apache2 - -That completes the apache configuration. The other half of the task is to configure php fpm so that it can finally work. - -### 2. Setup Php-FPM ### - -Next thing is to setup php fpm. Install it via synaptic, if not already done so. - - $ sudo apt-get install php5-fpm - -The configuration files for fpm are located at - -> /etc/php5/fpm - - /etc/php5/fpm$ ls - conf.d php-fpm.conf php.ini pool.d - -The pool.d directory contains the configuration file for each fpm pool and php-fpm.conf is the main configuration file. Our only work is to configure a fpm pool that is to be used with apache or the specific virtual host. - -The configuration file for a pool is quite large and there are many parameters that can be configured. But in this post we shall be talking about only the important fields that need be set to get fpm up and running - -> ; Start a new pool named 'www'. -> ; the variable $pool can we used in any directive and will be replaced by the -> ; pool name ('www' here) -> [www] -> -> ; Per pool prefix -> ; It only applies on the following directives: -> ; - 'slowlog' -> ; - 'listen' (unixsocket) -> ; - 'chroot' -> ; - 'chdir' -> ; - 'php_values' -> ; - 'php_admin_values' -> ; When not set, the global prefix (or /usr) applies instead. -> ; Note: This directive can also be relative to the global prefix. -> ; Default Value: none -> ;prefix = /path/to/pools/$pool -> -> ; Unix user/group of processes -> ; Note: The user is mandatory. If the group is not set, the default user's group -> ; will be used. -> user = enlightened -> group = enlightened -> -> ; The address on which to accept FastCGI requests. -> ; Valid syntaxes are: -> ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on -> ; a specific port; -> ; 'port' - to listen on a TCP socket to all addresses on a -> ; specific port; -> ; '/path/to/unix/socket' - to listen on a unix socket. -> ; Note: This value is mandatory. -> listen = 127.0.0.1:9000 -> -> ; Set listen(2) backlog. -> ; Default Value: 128 (-1 on FreeBSD and OpenBSD) -> ;listen.backlog = 128 - -Create a new configuration file by copying the www.conf file. And edit the fields as explained next. - -1. The first options is the name of the pool. We named it 'www' over here. Name it to anything you like or after the domain name it is going to be used with. 'yoursite' for example. That way it would be easier to remember. - -2. Setup the user and group that this pool will run with. When you are setting up multiple sites/domains/virtualhosts on a server, you would always want to setup separate user accounts and corresponding pool for each of those. This is an essential security measure, so that every pool has privileges of its own user only. - -3. Setup the listening socket. This is the socket on which the master fpm process shall listen for incoming requests. This can be a unix socket or a tcp socket. However [mod_proxy_fcgi does not yet support unix sockets][1], so we are limited to tcp sockets. -Over here its port number 9000 on localhost. - -Now restart fpm - - $ sudo service php5-fpm restart - -Now the new fpm pool should take effect. You can see the new pool process in htop for example. - -### 3. Test the setup ### - -Now that both apache and php fpm are configured and setup, its time to test. Get inside the document root directory and create a php file containing a call to phpinfo() function and open it in your browser. -The "Server API" should be reported as "FPM/FastCGI". - -Now that apache and php are setup, you may want to install other things like APC, mariadb database, phpmyadmin etc. Move around this site to find how-to guides on those. - -### Resources ### - -Check out the following links to learn more -[https://wiki.apache.org/httpd/PHP-FPM][2] - --------------------------------------------------------------------------------- - -via: http://www.binarytides.com/setup-apache-php-fpm-mod-proxy-fcgi-ubuntu/ - -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:https://issues.apache.org/bugzilla/show_bug.cgi?id=54101 -[2]:https://wiki.apache.org/httpd/PHP-FPM