Build a Linux development server environment

Source: Internet
Author: User
Tags password protection ssl connection

Development server environment setup

  • Purpose:Build a collaborative development environment on the Linux platform
  • Software:Linux 2.6 + apache2 + php4.x + mysql5.x; subversion1.3.1 + mantis1.0.2
  • Basic Ideas:
    • Build a web interface using lamp to facilitate management
    • Use Subversion for Version Control
    • Use TRAC for Bug (defect) Tracking (mantis is also optional ).

1. Install software
In Linux, the commonly used installation method is to use the RPM package. We use the Yum (or apt-Get) tool to solve the dependency between packages. The specific usage is not described here, ask Mr. google. If you think you can use the tar package to compile and install the package, you can also try it. However, it is not recommended that others help you with the installation. I will provide an automatic script here. Some software may not be found in your machine's configuration. You need to check it online, add the repository address to the yum configuration file.

#! /Bin/bash

# Install Python
Yum-y install python. i386 python-devel.i386 python-lxml.i386 python-sqlite.i386 swig. i386 python-clearsilver.i386

# Install Subversion
Yum-y install subversion. i386 subversion-devel.i386
 
# Install clearsilver
Yum-y install clearsilver. i386 clearsilver-devel.i386

# Install SQLite
Yum-y install clearsilver. i386 clearsilver-devel.i386

# Install Lamp
Yum-y install httpd. i386 mod_auth_mysql.i386 mod_dav_svn.i386 mod_log_ SQL .i386 mod_authz_ldap.i386 mod_python.i386 mod_ssl.i386

Yum-y install MySQL-python.i386 mysql. i386 mysql-devel.i386 mysql-server.i386

Yum-y install php-xml.i386 PHP. i386 mod_suphp.i386 php-devel.i386 php-ldap.i386 p-readline.i386

# Install optional
Yum-y install enscript. i386

# Install TRAC
Yum-y install TRAC. noarch

# Install mantis
Yum-y install Mantis. noarch

After the above software is installed, TRAC is installed in/usr/share/TRAC by default, and others should be in the/bin or/usr/bin directory.
After the software is installed, we will start to build our platform. We need to create two projects, projecta and projectb, and use the web interface for management.
2. Build a platform

  • Create a subversion repository and configure Subversion

Assuming the repository address is/work/repos, we perform the following operations:

# Svnadmin create -- FS-type fsfs/work/repos/projecta
# Svnadmin create -- FS-type fsfs/work/repos/projectb

After the above two steps, we have created two warehouses. Below we want to set them up, mainly including access permissions and service running modes. For usage of subversion, you can go to its website or SVN China to find this document.

  • Permission settings

It mainly sets the passwd and authz files under/work/repos/projecta/CONF/. For details about how to set them, refer to SVN help.

  • Service Running Mode

Subversion has three running modes: local, svnsever, and integration with Apache. We will use the last method. We will introduce how to configure it later.

  • Create and configure the TRAC Environment

Next we will create the TRAC environment. Suppose we install it in the/work/trac-ENV/directory and run the following command:

# Trac-admin/work/trac-ENV/projecta initenv
# Trac-admin/work/trac-ENV/projectb initenv

When you execute the above command, you will be asked about the svn repository address, telling it that it is under/work/repos/projecta,/work/repos/projectb, it doesn't matter if you make a mistake, because it can be configured manually and easily. The configuration file is stored in CONF/TRAC. ini. The significance and usage of specific configuration options are not described here. Refer to the instructions on its homepage.

  • Configure Apache

Our main focus is on how to combine subversion, TRAC, and Apache to provide a web management interface. Therefore, this part is a major concern.

If you follow the above script installation method, after the installation is complete, in/etc/httpd/CONF. d/subversion should exist under the directory. conf and TRAC. you can configure the conf files separately.

  • First, configure the subversion.

Configure/etc/httpd/CONF. d/subversion. conf.

Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so
# The above two lines are used in the home-in-Module
<Location/repos>
Dav SVN
# Svnpath/work/repos/projecta # If only one project is displayed, use this
Svnparentpath/work/repos # Show All projects
# Configure permissions below
# Limit write permission to list of valid users.
<Limitaskt get PROPFIND Options Report>
# Require SSL connection for password protection.
# Sslrequiressl
#
Authtype basic
Authname "Subversion repository"
Authuserfile/work/repos/. htpasswd # the password file must be generated using htpasswd.
Authzsvnaccessfile/work/repos/. authz # Administrative Group Permissions
Require valid-user
</Limit10000t>
</Location>

You can run the # htpasswd-CM/work/repos/command /. htpasswd LiRui to add a password for the user LiRui and create a file/work/repos /. authz and configure it according to SVN format requirements.

After the configuration is complete, restart the HTTP service: # apachectl restart
At this time, you can run the command: SVN Co http: // your_site_ip/repos/projecta
Check the source code of projecta locally (if you have the relevant permissions). If you have the write permission, you can directly submit the modification results using the svn commit command.

  • Configure TRAC again

Configure/etc/httpd/CONF. d/TRAC. conf. The following is a blueprint

# Set the directory permission. If you do not set this permission, you will get an error with no access permission, which is annoying.
<Directory "/usr/share/TRAC/htdocs">
Order allow, deny
Allow from all
</Directory>
# In the future, you can enter http: // your_site/TRAC for access. This TRAC. cgi is executed.

ScriptAlias/TRAC/usr/share/TRAC/cgi-bin/TRAC. cgi

### TRAC need to know where the database is located
<Location "/trac">
# Setenv trac_env "/work/trac-ENV/projecta" # If only one project is displayed, use this
Setenv trac_env_parent_dir "/work/trac-env" # display multiple projects
</Location>
 
### You need this to allow users to authenticate
<Location "/TRAC/login">
Authtype basic
Authname "trac"
Authuserfile/work/trac-ENV/TRAC. htpasswd # password file generated using htpasswd
Require valid-user
</Location>

ScriptAlias/TRAC/projecta/usr/share/TRAC/cgi-bin/TRAC. cgi

### TRAC need to know where the database is located
<Location "/TRAC/projecta">
Setenv trac_env "/work/trac-ENV/projecta" # If only one project is displayed, use this
# Setenv trac_env_parent_dir "/work/trac-env" # display multiple projects
</Location>
 
### You need this to allow users to authenticate
<Location "/TRAC/project/alogin">
Authtype basic
Authname "trac"
Authuserfile/work/trac-ENV/projecta/TRAC. htpasswd # Use the password file generated by htpasswd
Require valid-user
</Location>

ScriptAlias/TRAC/projectb/usr/share/TRAC/cgi-bin/TRAC. cgi

### TRAC need to know where the database is located
<Location "/TRAC/projecta">
Setenv trac_env "/work/trac-ENV/projectb" # If only one project is displayed, use this
# Setenv trac_env_parent_dir "/work/trac-env" # display multiple projects
</Location>
 
### You need this to allow users to authenticate
<Location "/TRAC/project/alogin">
Authtype basic
Authname "trac"
Authuserfile/work/trac-ENV/projectb/TRAC. htpasswd # Use the password file generated by htpasswd
Require valid-user
</Location>

Now that we have configured the system, enter http: // your_site_ip/TRAC/projecta in the browser to view the management system of the Web interface.

It is not very nice. Sometimes we only need to enter the IP address to find the webpage we need. For example, we enter http: // your_site to get a page, instead of http: // your_site_ip/TRAC/projecta. My approach is to create a file/var/www/html/index.html and set it to go to the corresponding page. Here is one of my settings:

<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
<HTML>
<Head>
<Title> Redirection </title>
<Meta http-equiv = "refresh" content = "0; url =/TRAC/projecta">
</Head>
<Body>
<H1> <center>
Edirecting to TRAC bug system... <br>
<A href = "/TRAC/projecta"> Haha, come here </a>
</H1>
</Body>
</Html>

Iii. Introduction

This part is to be written :)

Look at the time. It's about am. It's a little sleepy. I went back to the dormitory and went to bed ^_^.

 

 

Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 715784

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.