Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is the process flow diagram that a method embodiment of server web environment is built in the installation based on linux system provided by the invention, and as shown in Figure 1, the method comprises:
S101, operation shell installation script;
The type of S102, detection (SuSE) Linux OS;
S103, type according to detected (SuSE) Linux OS, install at least one in Apache web server Apache, hypertext pre-service language PHP and relational data management system MySQL.
In the present invention, server web environment is built for installation, provides required Apache source code bag, PHP(Hypertext Preprocessor) at least one in source code bag and MySQL source code bag, shell installation script, and other relevant source code bags, mounting list document etc.
Wherein, write install.sh, this file can carry out the step detecting Yu install.
As one preferably embodiment, before running shell installation script, can first by least one in the source code bag of the source code bag of Apache, the source code bag of PHP and MySQL, and shell installation script, relevant source code bag and mounting list document unzip in any one target directory in (SuSE) Linux OS, and then the installation file in operational objective catalogue, namely run the bash./install.sh file in this target directory.Install.sh supports 4 parameters: prepare, apache, mysql and php.Acquiescence bash./install.sh runs, and order of representation first detects the type of (SuSE) Linux OS, then installs apache successively, mysql and php.Also can directly input single parameter, some functions are only installed, as bash./install.sh mysql just only can reinstall mysql.
It should be noted that, the method for server web environment is built in the installation based on linux system provided by the invention, both can support to install the whole of Apache, PHP and MySQL; Can support again any one in Apache, PHP and MySQL or two are installed.Therefore, run shell installation script, originally detected the type of (SuSE) Linux OS by shell installation foot after, successively Apache can be installed, MySQL and PHP.Also can directly input single parameter, only install wherein some or two, as bash./install.sh mysql, then only MySQL is installed.
In installation process, can point out user required whole still parts of installing Apache, PHP and MySQL, user can pass through to reply certain character, such as: y adds carriage return to determine.
Wherein, linux system type can comprise linux system version number, company originated etc. information, and the linux system type such as comprised at present can see table:
After detecting linux system type, can install in Apache, PHP and MySQL adaptively according to the type of system one or more.
In addition, as one preferably embodiment, the source code bag of Apache, PHP and MySQL can be separated with configuration file and store, that is: under at least one in Apache, PHP and MySQL being installed to the first catalogue in (SuSE) Linux OS, under at least one in the configuration file of the configuration file of Apache, the configuration file of PHP and MySQL being installed to the second catalogue in (SuSE) Linux OS, the first catalogue and the second catalogue are the different directories in (SuSE) Linux OS.
Optionally, the first catalogue is /usr/local/webserver.Such as:
/usr/local/webserver/apache2
/usr/local/webserver/mysql,/usr/local/webserver/php。
Optionally, the second catalogue that the configuration file of Apache is corresponding is /etc/httpd/httpd.conf, the second catalogue that the configuration file of PHP is corresponding is the second catalogue that the configuration file of 2.mysql:/etc/my/cnf, MySQL is corresponding is /usr/local/webserver/php/etc/php.nin.
After successful installation, Apache, PHP and MySQL can be started by running to issue orders, such as:
Apache starts (stop | restarting | heavily loaded configuration file)
service httpd start(stop|restart|reload)
Mysql(stops | restarting | heavily loaded configuration file)
service mysqld start(stop|restart|reload)
The method of server web environment is built in installation based on linux system provided by the invention, originally the type of (SuSE) Linux OS was detected by running shell installation foot, and according to the type of detected (SuSE) Linux OS, at least one in Apache web server Apache, hypertext pre-service language PHP and relational data management system MySQL is installed.Realize the server web environmental structure complexity under reduction linux system, reduce the compatibility requirement that server web is applied.
Fig. 2 is the structural representation that a device embodiment of server web environment is built in the installation based on linux system provided by the invention, as shown in Figure 2, comprising:
Run module 11, for running shell installation script;
Detection module 12, for detecting the type of (SuSE) Linux OS;
Installation module 13, for the type according to detected (SuSE) Linux OS, installs at least one in Apache web server Apache, hypertext pre-service language PHP and relational data management system MySQL.
As shown in Figure 3, this device can further include: decompression module 14, for by least one in the source code bag of the source code bag of Apache, the source code bag of PHP and MySQL, and shell installation script, relevant source code bag and mounting list document unzip in any one target directory in (SuSE) Linux OS;
Run module 11 can also be used for: the installation file in operational objective catalogue.
Optional installation module 13 can also be specifically for: under at least one in Apache, PHP and MySQL being installed to the first catalogue in (SuSE) Linux OS, under at least one in the configuration file of the configuration file of Apache, the configuration file of PHP and MySQL being installed to the second catalogue in (SuSE) Linux OS, the first catalogue and the second catalogue are the different directories in (SuSE) Linux OS.
Optionally, the first catalogue is /usr/local/webserver.
Optionally, the second catalogue that the configuration file of Apache is corresponding is /etc/httpd/httpd.conf, the second catalogue that the configuration file of PHP is corresponding is the second catalogue that the configuration file of 2.mysql:/etc/my/cnf, MySQL is corresponding is /usr/local/webserver/php/etc/php.nin.
The device of server web environment is built in the installation based on linux system that the present embodiment provides, the actuating unit of the method for server web environment is built for the installation based on linux system provided by the invention, its detailed process performing the method can associated description in embodiment shown in Figure 1, does not repeat them here.
Those skilled in the art can be well understood to, for convenience and simplicity of description, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by device is divided into different functional modules, to complete all or part of function described above.The system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that, disclosed system, apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described module or unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If described integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that the technical scheme of the application contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) perform all or part of step of method described in each embodiment of the application.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. various can be program code stored medium.
The above, above embodiment only in order to the technical scheme of the application to be described, is not intended to limit; Although with reference to previous embodiment to present application has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of each embodiment technical scheme of the application.