المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to rebuild Apache and PHP in WHM



Rise Company
02-12-2015, 08:36
7. How to rebuild Apache and PHP in WHM At some point in time, you're probably going to have to recompile Apache and PHP. This is necessary any time you wish to upgrade to the latest version, enable or disable a module or feature, et cetera.
WHM provides you with a convenient tool called EasyApache.This tool gives you the freedom to customize every little detail, if you want, or to choose from an existing configuration profile.
1) Find the Software category of the menu.
https://www.rise.company/forum/images/imported/2015/12/frame02_1png-1.jpg
2) Click the EasyApache link.
https://www.rise.company/forum/images/imported/2015/12/frame03_1png-1.jpg
It will check for updates first, then should forward you to the user interface.
https://www.rise.company/forum/images/imported/2015/12/frame04_1png-1.jpg
If you'd like more information before using EasyApache, you can always read over the documentation, found using the links above.
3) Select a profile from the list. Check out the More Info links if you'd like more details about each one.
https://www.rise.company/forum/images/imported/2015/12/frame05_1png-1.jpg
4) Click Build Profile Now if you'd like to go ahead and rebuild Apache and PHP without making any changes to the profile first.
https://www.rise.company/forum/images/imported/2015/12/frame06_1png-1.jpg
We're going to customize the Previously Saved Config.
You can keep track of your progress and return to previous pages up here.
5) Select the version of Apache you want to build.
https://www.rise.company/forum/images/imported/2015/12/frame08_1png-1.jpg
6) Click Next Step to proceed.
https://www.rise.company/forum/images/imported/2015/12/frame09_1png-1.jpg
7) Select the main versions of PHP you want to build; we'll be sticking with PHP 5. You can choose to install both -- or neither -- if you wish.
8) Next Step.
https://www.rise.company/forum/images/imported/2015/12/frame11_1png-1.jpg
9) Now, select the minor version to build of each major PHP version.
https://www.rise.company/forum/images/imported/2015/12/frame13_1png-1.jpg
Typically, the latest version is best.
10) Now, for the Short Options List. Work your way through the list, enabling or disabling whatever you want. Be sure to enable only what you need; installing too many modules can cause performance issues.
https://www.rise.company/forum/images/imported/2015/12/frame14_1png-1.jpg
Assume that if an option on our screen is already enabled and we don't mention it, you should enable it on yours, if it isn't already.
You'll have to confirm most options, but we won't show that for every one.
https://www.rise.company/forum/images/imported/2015/12/frame15_1png-1.jpg
The Frontpage Extensions for Apache have security issues and bugs. Frontpage itself has been discontinued since 2006.
https://www.rise.company/forum/images/imported/2015/12/frame16_1png-1.jpg
11) So, we'll turn Frontpage off.
https://www.rise.company/forum/images/imported/2015/12/frame18_1png-1.jpg
12) Mod SuPHP is a module for PHP similar to the suEXEC module for Apache. It helps decrease the security risks involved with running PHP scripts. This option requires that PHP runs in CGI mode; enabling it will make the necessary changes automatically.
https://www.rise.company/forum/images/imported/2015/12/frame19_1png-1.jpg
13) The IonCube Loader for PHP is required to run some PHP programs having encrypted source code.
https://www.rise.company/forum/images/imported/2015/12/frame20_1png-1.jpg
14) ModSecurity is a web application firewall for Apache; it increases security by detecting and preventing attacks before they reach web applications. You'll be able to configure this in WHM later, once enabled.
https://www.rise.company/forum/images/imported/2015/12/frame23_1png-1.jpg
15) Suhosin is an advanced protection system for PHP, designed to protect servers and users from flaws in PHP itself.
https://www.rise.company/forum/images/imported/2015/12/frame24_1png-1.jpg
16) SourceGuardian is similar to IonCube.
https://www.rise.company/forum/images/imported/2015/12/frame25_1png-1.jpg
17) At the bottom of this page, you have the option to Save and Build your profile as it is now.
18) Or, go to the Exhaustive Options List for further configuration options.
https://www.rise.company/forum/images/imported/2015/12/frame26_1png-1.jpg
19) First on this page is the list of Apache Built-in Modules. You shouldn't need to enable or disable these any further than we did on the previous page, unless you're certain you need to do so.
https://www.rise.company/forum/images/imported/2015/12/frame27_1png-1.jpg
This is the only PHP-related module here; the core PHP modules can be enabled or disabled further down the page.
20) Next is the Other Modules section. All of these were on the previous page, so let's skip down to the PHP section.
https://www.rise.company/forum/images/imported/2015/12/frame33_1png-1.jpg
Most of the changes you'll make on this page will probably be to the PHP options, shown here. You should see a section like this for each version of PHP you'll be installing.
21) cURL allows PHP scripts to connect to many different types of servers, such as web servers and FTP servers.
Let's enable cURL and its SSL support (for encrypted connections).
https://www.rise.company/forum/images/imported/2015/12/frame38_1png-1.jpg
22) GD (or Graphics Draw) is a library of functions for PHP that allows programmers to create and manipulate images in a variety of different formats.
https://www.rise.company/forum/images/imported/2015/12/frame41_1png-1.jpg
Many PHP programs use this, so you should turn it on.
23) The Zlib module for PHP is required to install GD.
24) Mbstring allows PHP to handle working with "multi-byte strings". This module is required in order to work with alphabets other than Latin.
https://www.rise.company/forum/images/imported/2015/12/frame44_1png-1.jpg
25) Mcrypt enables a number of advanced encryption algorithms. A number of the algorithms are used by governments to protect Top Secret information.
https://www.rise.company/forum/images/imported/2015/12/frame45_1png-1.jpg
26) Closely related to Mcrypt is Mhash. Hashing algorithms are similar to encryption algorithms, with the key difference being that hashing is irreversible.
https://www.rise.company/forum/images/imported/2015/12/frame46_1png-1.jpg
27) Let's enable both of those.
28) The MySQL "Improved" extension provides programmers with more efficient access to a MySQL server and its databases. It should work with all recent versions of MySQL. Click here to enable it.
https://www.rise.company/forum/images/imported/2015/12/frame48_1png-1.jpg
29) Enabling Safe PHP CGI prevents users from overriding your system PHP.ini settings when running PHP in CGI mode.
https://www.rise.company/forum/images/imported/2015/12/frame51_1png-1.jpg
30) Ticking the checkbox next to TTF (FreeType) gives the GD extension better font support.
https://www.rise.company/forum/images/imported/2015/12/frame52_1png-1.jpg
That's all of the options for PHP.
Here are some preferences that you should not need to change, but can if you wish.
https://www.rise.company/forum/images/imported/2015/12/frame54_1png-1.jpg
31) If you want, you can use this form to save your settings as a custom profile that will be selectable with the rest of the profiles later on. If you don't fill out this form, your choices will still be saved as "Previously Saved Config".
https://www.rise.company/forum/images/imported/2015/12/frame55_1png-1.jpg
32) Click here to Save your profile without building it...
33) ...or here to save and build your profile.
34) Confirm.
https://www.rise.company/forum/images/imported/2015/12/frame56_1png-1.jpg
35) Acknowledge that you understand terminating the build process can cause data loss. Apache will be rendered unusable if this process is killed prematurely.
https://www.rise.company/forum/images/imported/2015/12/frame57_1png-1.jpg
You will be notified of any necessary adjustments to your configuration, then forwarded automatically to the build page.
https://www.rise.company/forum/images/imported/2015/12/frame58_1png-1.jpg
If anything goes wrong, the entire build log will be saved to the path shown above in bold for troubleshooting purposes.
If you receive "Out of memory" errors below, you will need to run the build manually by command line. That's beyond the scope of this tutorial. Most servers should run EasyApache in a browser just fine.
https://www.rise.company/forum/images/imported/2015/12/frame59_1png-1.jpg
You might also find these profile-related links useful.
Barring any unexpected errors or a server crash, the build process will continue in the background until finished, even if the browser window is closed.
You'll see output from the process in this box, as the build goes on.
https://www.rise.company/forum/images/imported/2015/12/frame61_1png-1.jpg
It could take an hour or two for the build to complete, depending on your settings.
When the build is complete, you should see this box pop up, telling you to configure suEXEC and PHP.
https://www.rise.company/forum/images/imported/2015/12/frame62_1png-1.jpg
This page allows you to choose which of the PHP versions available on your system are active.
https://www.rise.company/forum/images/imported/2015/12/frame63_1png-1.jpg
You can also enable suEXEC for Apache, which decreases the security risks when running CGI and SSI programs. Note that this has no effect on PHP scripts -- that's where suPHP comes in.
In order for suPHP to work, you must select it as the handler for each version of PHP you have installed.
If you have both versions of PHP on your system, you'll need to choose which is used by default to execute .php files.
36) When finished, click Save New Configuration.
You will be shown the settings you chose and the generated php.conf file.
https://www.rise.company/forum/images/imported/2015/12/frame64_1png-1.jpg
That's it! Apache and PHP have been re-built. If all went well, all the websites on your system should function normally.
If you mis-configured anything, you can always come back here and re-build Apache and PHP.

Rise Company
02-12-2015, 10:13
+restart Apache