RMP package format Installation lamp, provides two virtual machines, one for WordPress, one for phpMyAdmin, provides SSL access

Source: Internet
Author: User
Tags echo date test web server blank page phpmyadmin rpmbuild startssl

Rpm-i your-package.rpm

Where your-package.rpm is the file name of the RPM package you want to install, typically placed in the current directory.

The following warnings or prompts may appear during installation:

..... conflict with ... There may be some files in the package to be installed that may overwrite the existing

Files that are not properly installed by default in this case can be used

RPM--force-i forced installation can be

... are needed by ...

... are not installed ... This package requires some software that you do not have installed can be used

RPM--nodeps-i to ignore this information

That is, rpm-i--force--nodeps can ignore all dependencies and file problems, what packages

Can be installed, but this force-installed package does not guarantee full functioning


2. How to install the. src.rpm Package

Some packages end in. src.rpm, which is the RPM package that contains the source code, at the time of installation

needs to be compiled. This type of package has two installation methods,

Method One:

1. Execution of Rpm-i your-package.src.rpm

2. Cd/usr/src/redhat/specs

3. RPMBUILD-BP your-package.specs A specs file with the same name as your package

4. cd/usr/src/redhat/build/your-package/a directory with the same name as your package

5./configure This step is the same as compiling the common source code software, you can add parameters

6. Make

7. Make Install


Method Two:

1. Execution of Rpm-i you-package.src.rpm

2. Cd/usr/src/redhat/specs

The first two steps are the same as the method one

3. RPMBUILD-BB your-package.specs A specs file with the same name as your package

At this time, in the/usr/src/redhat/rpm/i386/(depending on the specific package, it may be i686,noarch, etc.)

In this directory, there is a new RPM package, which is a compiled binary file.

Perform rpm-i new-package.rpm to install.


3. How to uninstall the RPM package

With the command rpm-e the package name, the package name can contain information such as the version number, but there can be no suffix. rpm

For example, uninstalling the package proftpd-1.2.8-1, you can use the following format:

Rpm-e Proftpd-1.2.8-1

Rpm-e proftpd-1.2.8

Rpm-e proftpd-

Sometimes there are some errors or warnings:

... are needed by ... This means that the software is required by other software and can not be uninstalled arbitrarily

Can be forced to unload with RPM-E--nodeps


4. How to not install but get the files in the RPM package

Using Tools Rpm2cpio and Cpio

Rpm2cpio xxx.rpm | Cpio-vi

Rpm2cpio xxx.rpm | Cpio-idmv

Rpm2cpio xxx.rpm | Cpio--extract--make-directories

The parameters I and extract are the same, which means extracting the files. V indicates that the execution process

D is the same as make-directory, which means that the directory is created according to the original path of the file in the package

M indicates the time to keep the file updated.


5. How to view files and other information related to RPM packages

All of the following examples assume the use of package mysql-3.23.54a-11

1. The RPM packages are installed in my system

Rpm-qa to list all installed packages

If you want to find all installed packages that contain a string of SQL

RPM-QA |grep SQL


2. How to get the full file name of a package

Rpm-q MySQL can get the full name of the MySQL package installed in the system, from which you can get

Information such as the version of the current package. In this example, you can get information mysql-3.23.54a-11


3. Where are the files in one RPM package installed?

RPM-QL Package Name

Note Here is the name of the package that does not include the. rpm suffix

That means you can use MySQL or mysql-3.23.54a-11 instead of mysql-3.23.54a-11.rpm.

If you just want to know where the executable program goes, you can also use which, such as

which MySQL


4. One RPM package contains those files

A package that has not been installed, using RPM-QLP ****.rpm

An already installed package, you can also use RPM-QL ****.rpm


5. How do I get information about a package's version, usage, etc.?

A package that has not been installed, using RPM-QIP ****.rpm

An already installed package, you can also use Rpm-qi ****.rpm


6. Which package is installed for a program, or which package contains the program

RPM-QF ' which program name ' returns the full name of the package

Rpm-qif ' which program name ' returns information about the package

RPM-QLF ' which program name ' Returns the file list of the package

Note that this is not a quotation mark, but a ', the key in the upper left corner of the keyboard.

You can also use RPM-QILF to output package information and file lists


7. Which package is installed for a file, or which package contains this file

Note that the method in the previous question only applies with the executable program, while the following method can not only

Can be used for executable programs, or for any normal file. The prerequisite is to know the file name.

First get the full path to the program, either with Whereis or which, and then using RPM-QF for example:

# Whereis Ftptop

Ftptop:/usr/bin/ftptop/usr/share/man/man1/ftptop.1.gz

# Rpm-qf/usr/bin/ftptop

Proftpd-1.2.8-1

# Rpm-qf/usr/share/doc/proftpd-1.2.8/rfc/rfc0959.txt

Proftpd-1.2.8-1


Summarize:

Obtain package-related information with rpm-q,q to query queries, followed by other options, such as

I means info, get the package information;

L represents list, obtains the file listing;

A represents all, and queries are executed in all packages;

f denotes file, and the relevant query according to the document;

P means package, query according to the packages


LAMP

Configuring the Environment

Operating system: Redhat Enterprise as 4

Installed packages: httpd2.0.4, mysql4.1,libxml2.6.16, zlib1.2.1.2,gd2.0.28, libpng1.2.7

Description: The various installation instructions on the Internet are not very good to explain the reason for the configuration parameters, this article will try to indicate the necessity of each step. Installed packages are not required, where MySQL can be installed independently, and RPM package form httpd because it is not installed in mod-so form, if you want to support PHP or other modules, to force Remove to reinstall the encoded version. #rpm--nodeps--erase httpd

Other PHP modules that may be required for function description:

Libxml2:xml Parsing Library

Zlib: Open Source Compression Library

GD: Graphics Library

Libpng: A library for working with PNG image format files

Freetype:truetype Font Drawing engine

Zendoptimizer:


First step: Install Apache

Go to the installation directory and execute the following command in turn:

Unzip the source package

# TAR-ZXF Httpd-2.0.55.tar.gz

Go to the installation directory

# CD httpd-2.0.55

Configure Apache installation information, configure post-installation directory, module dynamic configuration, allow override reconfiguration

#./configure--prefix=/usr/local/apache--enable-modules=so--enable-rewrite

Perform a Make installation

# make; Make install



Step Two: Configure Apache

Modify the httpd.conf file

ServerName Modify host name, if no DNS, use IP instead

ServerName 192.168.36.163:80


DocumentRoot Modify the document path, which is where you want to place the target page

DocumentRoot "/var/www/html"



DirectoryIndex Modifying the default home name

DirectoryIndex index.html index.php index.htm


2 the PHP 5.2.3 Zip package inside the php_mysql.dll copy to the PHP installation root directory, it is recommended to restart IIS, and then debug phpMyAdmin 3. Configure php.ini  PHP5 default does not support mSQL, So we need to configure the Php.inc (1) To set the extension path   find Extension_dir There is such a line; Extension_dir = "./"   adds a row after the line (note that it is added to a row, not added to the back) extension _dir = "D:\php\ext"   where d:\php is your path to install PHP. Incorrect path will not load DLL   (2) Find extension   Extension=php_mbstring.dll extension=php_gd2.dll Extension=php_mysql.dl & nbsp Remove the semicolon from the preceding 3 items so that IIS can load the DLLs at startup     (3) Set the session save path   Find Session.save_path has this line;     Session.save_path = "N;/path" adds a line after this line  session.save_path = "C:\WINDOWS\Temp"     Save to your temp directory , which can be completely saved to the Windows Temp directory under temp   (4) It is also worth noting that the Short_open_tag default is off  

That is, PHP cannot use short tags such as <?> must use <?php?>   is easy to use due to short marks, and many programs are written in short marks, such as Discuz   if not Short_open_tag Changes to on will appear the symptoms will be difficult to determine is the above reason, it is recommended to modify   Find  short_open_tag = Off to  short_open_tag = on   (5) Whether the error is displayed Display_err ORS   For security reasons, Display_errors also defaults to OFF   that is, when debugging, only a blank page appears if the PHP code is wrong. It does not show the cause of the error and the number of rows that were faulted.   Such debugging will be very inconvenient, it is recommended to modify the search according to their needs  register_globals = Off to  register_globals = on   (6) Register_globals &N BSP; For security reasons it is also off by default   when Register_globals=off, the next program should be received with $_post[' user_name ' and $_post[' User_pass '])   When Register_globals=on, the next program can accept values directly using $user_name and $user_pass.     suggest to modify   (7) PHP5 time difference problem  <?php echo date ("y-m-d h:i:s") According to your needs? What is the difference between > time and eight hours? PHP5 Series new time zone setting, default is GMT, and China is located in the East 8 district exactly 8 hours   Find Date.timezone have such a line;d Ate.timezone = will, remove, change to  date.timezone = PRC  

Among them Prc:people's Republic of China first question: "Unable to load mcrypt extension, check PHP configuration".  1, the MySQL database is not installed correctly, in the system service MySQL related services did not start. 2, in the system system32 (C:\WINDOWS\SYSTEM32) directory is missing Libmcrypt.dll file, solution

is to locate the Libmcrypt.dll in the PHP directory, copy the Libmcrypt.dll to the C:\windows\system32 directory, and then restart the Web service. 3, in the PHP directory of the php.ini file, there is no "; Extension=php_mcrypt.dll" in the previous ";" Remove, so can not use the corresponding function, the solution is to open the php.ini file, find; Extension=php_mcrypt.dll change to Extension=php_mcrypt.dll//Remove the front; make it effective


apache_1.3.11.tar.gz (server) mod_ssl-2.5.0-1.3.11.tar.gz (SSL interface Module) openssl-0.9.4.tar.gz (SSL Security and Algorithm class library) mod_perl-1.21 . tar.gz (Perl interface Module) RSAREF20.TAR.Z (RSA algorithm package) perl5.005_03.tar.gz (Perl environment)



2, mod_ssl-http://www.modssl.org/    This is a software module that provides strong encryption for apache1.3.x Web server, using SSL V2 and V3 and TLS (Transport Layer Security) V1 protocol. The package was developed under BSD license, and in the non-commercial case you are free to use it, to determine which version of the mod_ssl to use is very simple, its version number is-format, that is, if you are using 1.3.11 Apache, Then you should use 2.50-1.3.11 's mod_ssl.     3, mod_perl-http://perl.apache.org/dist/  apache1.3.x Perl interface Module     4, Open ssl-http://www . openssl.org/??????     This package provides cryptographic protection of the SSL V2/v3 (secure Sockets layer) and the TLS v1 (Transport layer Security) protocol.   &NBSP;5, Rsaref-use search engines to find "rsaref20.tar.z" should be able to find the RSA encryption algorithm implementation package   &NBSP;6, Perl compression, installation (see Perl Introduction)     Perl is a programming language. It is a very popular programming language that is popular in text processing, port communication, coordinating many different applications, and accomplishing many other tasks. Perl is also a popular CGI programming language, but this is only one of many Perl applications   We will install these programs in the/usr/local directory Add function module can give Apache more powerful function, if you need more modules, To get it yourself and load it, like mod_php This module is also now popular, can make Apache provide PHP script support ... Third, the installation of software packages     Before actual installation we have to decide what environment we will install the Web server in, for a person who has a very high security requirements, can install the server and software in chroot environment, chroot change root Directory and execute the program only in this directory, which provides a small built-in environment, even if the intruder has passed CGI programs or otherApproach through 80 port access to the system, it can only be active in this limited environment, from a security point of view, which is of course the best, but for the system administrator, this installation is relatively troublesome, but also some necessary libraries, Perl and related tools have to be moved to chroot, so-- You decide for yourself, and here we're going to install it under chroot. Expand these packages:     #gzip-D-C apache_1.3.11.tar.gz | Tar xvf-    #gzip-D-C mod_ssl-2.5.0-1.3.11.tar.gz | Tar xvf-  #gzip-D-C openssl-0.9.4.tar.gz | Tar xvf-  #gzip-D-C mod_perl-1.21.tar.gz | Tar xvf-    Expand and compile rsaref     #mkdir rsaref     #cd rsaref     #gzip-D-C. /rsaref20.tar.z | Tar xvf-  #tar xvf rsaref.tar     #cp-rp Install/unix temp     #cd temp     #make &nbs P   #mv rsaref.a librsaref.a     #cd: /.. / 

    Compile OpenSSL     #cd openssl-0.9.4     #perl Util/perlpath.pl/usr/bin/perl (Path to Perl) & nbsp #./config-l ' pwd '/. /rsaref/temp/    #make     #make test     #cd.       Add Mod_perl to APACHE compilation options     #cd mod_perl-1.21     #perl makefile.pl Apache_prefix =/usr/local/apache \   apache_src=. /APACHE_1.3.11/SRC \     Use_apaci=1     You'll get the following hint:    configure mod_perl with. /apache_1.3.11/src? [y]   press ENTER directly is the default Yes     then makefile will ask you whether to build httpd, you can use N to choose not.   #make     #make install     #cd.     Add mod_ssl to Apache     #cd mod_ssl-2.5.0-1.3.11     #./configure--with-apache=. /apache_1.3.11 \  --prefix=/usr/local/apache \    --with-ssl=. /openssl-0.9.4 \    --with-rsa=. /rsaref/temp \    --ACTIVATE-MODULE=SRC/MODULES/PERL/LIBPERL.A   #cd..   Compiling Apache:   &nbsp #cd apache_1.3.11     We can do one more thing before compiling--edit the file that contains the version number of the HTTP server, so that the intruder who wants it can't touch the head:)   # Src/include/httpd.h     Look for the following line (approx. 454) and change the server's name and version number--you can use whatever you want to change.    define server_baseversion "apache/1.3.11"   Now you can compile Apache out     #make     Now you can generate a CA ( Actual certificate).     #make certificate     Follow the instructions for installation of this authorisation.   #make Install  

  This will put Apache in/usr/local/apache.     Test Web server (not yet SSL) is healthy----Call Web server:  /usr/local/apache/bin/apachectl start??     When the Web server is running, you can connect to your 80 port with Lynx or any browser, and if you can see the Apache welcome page, OK.   Stop server:    /usr/local/apache/bin/apachectl stop     test Web server (simultaneous SSL)-call a Web server with SSL &NB Sp  /usr/local/apache/bin/apachectl startssl     Server runtime you see Https://your.ip.here/with Netscape or other SSL-enabled browsers, Did you see the Welcome page?     To stop the server:    /USR/LOCAL/APACHE/BIN/APACHECTL stop????   Apache configuration     Now we can take a look at the Apache configuration file--it's important to remember that if you make changes to it,   it won't work until the httpd daemon is restarted. OK, now we can go into the catalogue  /usr/local/apache/conf to see.   &NBSP;HTTPD.CONF-    This is the main configuration file for Apache, where you can set the basic environment for server startup, such as service??   Start mode, port number, the maximum number of connections allowed, and so on, this file is very detailed comments, to see the Ming??   White should have no problem.   &NBSP;ACCESS.CONF-    This file is set in the system access mode and environment, but now can be set in the httpd.conf,   so recommend you do not touch it, empty.    srm.conf-      This guy is mostly a resource.On the settings, you can also empty, just set the httpd.conf in the relevant items.   Restart Web server now to make the changes effective:   &NBSP;#/USR/LOCAL/APACHE/BIN/APACHECTL restart



2, mod_ssl-http://www.modssl.org/    This is a software module that provides strong encryption for apache1.3.x Web server, using SSL V2 and V3 and TLS (Transport Layer Security) V1 protocol. The package was developed under BSD license, and in the non-commercial case you are free to use it, to determine which version of the mod_ssl to use is very simple, its version number is-format, that is, if you are using 1.3.11 Apache, Then you should use 2.50-1.3.11 's mod_ssl.     3, mod_perl-http://perl.apache.org/dist/  apache1.3.x Perl interface Module     4, Open ssl-http://www . openssl.org/??????     This package provides cryptographic protection of the SSL V2/v3 (secure Sockets layer) and the TLS v1 (Transport layer Security) protocol.   &NBSP;5, Rsaref-use search engines to find "rsaref20.tar.z" should be able to find the RSA encryption algorithm implementation package   &NBSP;6, Perl compression, installation (see Perl Introduction)     Perl is a programming language. It is a very popular programming language that is popular in text processing, port communication, coordinating many different applications, and accomplishing many other tasks. Perl is also a popular CGI programming language, but this is only one of many Perl applications   We will install these programs in the/usr/local directory Add function module can give Apache more powerful function, if you need more modules, To get it yourself and load it, like mod_php This module is also now popular, can make Apache provide PHP script support ... Third, the installation of software packages     Before actual installation we have to decide what environment we will install the Web server in, for a person who has a very high security requirements, can install the server and software in chroot environment, chroot change root Directory and execute the program only in this directory, which provides a small built-in environment, even if the intruder has passed CGI programs or otherApproach through 80 port access to the system, it can only be active in this limited environment, from a security point of view, which is of course the best, but for the system administrator, this installation is relatively troublesome, but also some necessary libraries, Perl and related tools have to be moved to chroot, so-- You decide for yourself, and here we're going to install it under chroot. Expand these packages:     #gzip-D-C apache_1.3.11.tar.gz | Tar xvf-    #gzip-D-C mod_ssl-2.5.0-1.3.11.tar.gz | Tar xvf-  #gzip-D-C openssl-0.9.4.tar.gz | Tar xvf-  #gzip-D-C mod_perl-1.21.tar.gz | Tar xvf-    Expand and compile rsaref     #mkdir rsaref     #cd rsaref     #gzip-D-C. /rsaref20.tar.z | Tar xvf-  #tar xvf rsaref.tar     #cp-rp Install/unix temp     #cd temp     #make &nbs P   #mv rsaref.a librsaref.a     #cd: /.. / 

    Compile OpenSSL     #cd openssl-0.9.4     #perl Util/perlpath.pl/usr/bin/perl (Path to Perl) & nbsp #./config-l ' pwd '/. /rsaref/temp/    #make     #make test     #cd.       Add Mod_perl to APACHE compilation options     #cd mod_perl-1.21     #perl makefile.pl Apache_prefix =/usr/local/apache \   apache_src=. /APACHE_1.3.11/SRC \     Use_apaci=1     You'll get the following hint:    configure mod_perl with. /apache_1.3.11/src? [y]   press ENTER directly is the default Yes     then makefile will ask you whether to build httpd, you can use N to choose not.   #make     #make install     #cd.     Add mod_ssl to Apache     #cd mod_ssl-2.5.0-1.3.11     #./configure--with-apache=. /apache_1.3.11 \  --prefix=/usr/local/apache \    --with-ssl=. /openssl-0.9.4 \    --with-rsa=. /rsaref/temp \    --ACTIVATE-MODULE=SRC/MODULES/PERL/LIBPERL.A   #cd..   Compiling Apache:   &nbsp #cd apache_1.3.11     We can do one more thing before compiling--edit the file that contains the version number of the HTTP server, so that the intruder who wants it can't touch the head:)   # Src/include/httpd.h     Look for the following line (approx. 454) and change the server's name and version number--you can use whatever you want to change.    define server_baseversion "apache/1.3.11"   Now you can compile Apache out     #make     Now you can generate a CA ( Actual certificate).     #make certificate     Follow the instructions for installation of this authorisation.   #make Install  

  This will put Apache in/usr/local/apache.     Test Web server (not yet SSL) is healthy----Call Web server:  /usr/local/apache/bin/apachectl start??     When the Web server is running, you can connect to your 80 port with Lynx or any browser, and if you can see the Apache welcome page, OK.   Stop server:    /usr/local/apache/bin/apachectl stop     test Web server (simultaneous SSL)-call a Web server with SSL &NB Sp  /usr/local/apache/bin/apachectl startssl     Server runtime you see Https://your.ip.here/with Netscape or other SSL-enabled browsers, Did you see the Welcome page?     To stop the server:    /USR/LOCAL/APACHE/BIN/APACHECTL stop????   Apache configuration     Now we can take a look at the Apache configuration file--it's important to remember that if you make changes to it,   it won't work until the httpd daemon is restarted. OK, now we can go into the catalogue  /usr/local/apache/conf to see.   &NBSP;HTTPD.CONF-    This is the main configuration file for Apache, where you can set the basic environment for server startup, such as service??   Start mode, port number, the maximum number of connections allowed, and so on, this file is very detailed comments, to see the Ming??   White should have no problem.   &NBSP;ACCESS.CONF-    This file is set in the system access mode and environment, but now can be set in the httpd.conf,   so recommend you do not touch it, empty.    srm.conf-      This guy is mostly a resource.On the settings, you can also empty, just set the httpd.conf in the relevant items.   Restart Web server now to make the changes effective:   &NBSP;#/USR/LOCAL/APACHE/BIN/APACHECTL restart


After everything is working properly we can remove the front of those servers installed under the things--/usr/local,   including servers and those built-in modules and so on.     #rm-rf/usr/local/apache     #rm-rf/usr/local/mod_ssl-2.5.0-1.3.11/  #rm-rf/usr/local/mo d_perl-1.21/    #rm-rf/usr/local/openssl-0.9.4/    #rm-rf/usr/local/rsaref     If you want to change it later Their configuration, add new modules, then leave the original Apache will be OK.   Set Apache to self-start at boot time, modify/etc/rc.d/rc.local and add the following lines:   echo "Starting Apache-ssl"    /usr/sbin/chroot/ Apache/bin/apachectl Startssl     If everything works, then congratulations, you have successfully run Apache with SSL support??  , this will make your Web server more secure, if you want to add more modules to implement other functions of the  , do it yourself, finally, the last thing to say is: In the chroot environment, it is best to only some of the necessary binary process   sequence, And the suid procedure is better to kill. (http://www.fanqiang.com/) go to "UNIX Forum"   Note:     This is possible in the LAN, but there may be a situation in the WAN:     Because the encryption certificate is generated by ourselves and self-signed, and has not been recognized by the wide-area certificate provider, may be on the HTML connection, will pop up a question, whether to trust the certificate provider (this time the certificate provider is the company). If you want to get a certificate from a wide-area certificate provider, you can look for a Web site that costs about $300-500, so on the HTML connection, the above question will not pop up because of the wide area certificate.   Section III Perl Introduction and installation     in version 5.00503, for example, the above command will create a perl5.005_03 subdirectory under the current directory.Recording, then   &NBSP;CD perl5.005_03    ./configure     Configure will try to get the set value for your system, press [Enter] and nbsp   If you feel tired by pressing [Enter] to answer the question,./configure This command can be replaced by./configure-des, then Configure will use it to find the set value, no longer seek the user's confirmation. Next   make    make test


RMP package format Installation lamp, provides two virtual machines, one for WordPress, one for phpMyAdmin, provides SSL access

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.