Lnamp PHP Multi-person development environment Configuration tutorial

Source: Internet
Author: User
Tags file permissions iptables

Often heard the team said: "This version of the expansion is really hard to find, in the local operation of the normal code, on the line after the run exception ..." Most of these problems are due to system differences, extended deletions, and version differences. To solve such problems, build a consistent and online multiple-person development environment to solve.
Idea: Build a local development server, the development server and the online server environment consistent, with the Samba service map to the local computer disk, the team of everyone's development code is stored on the development machine, everyone's code is running on the development machine, team members no longer need to build a separate development environment, Only need to mount the remote directory to the local disk, plus DNS resolution, on the development machine Apache according to the domain name binding corresponding directory.
Build process:

1. A PC host, U disk installation CentOS5.11;

2. Install lamp or Lnamp or LNMP environment, there are many tutorials about Lnamp or lamp combination installation (another blog post I wrote, please step into the->:lamp installation notes if necessary (centos6.4+apache-2.2.22+ Mysql-5.1.63+php-5.2.17+phpmyadmin-, the installation process no longer repeat, this article is mainly about how to configure a multiple-person development environment.

3. Configuration steps

Modify firewall rules

Add the following rule
-A rh-firewall-1-input-p tcp-m tcp--dport 137-j ACCEPT
-A rh-firewall-1-input-p tcp-m tcp--dport 138-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 139-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 445-j ACCEPT
Service Iptables Restart

4. Installing Samba

Yum Install samba System-config-samba samba-client Samba-common

Edit Samba configuration file

Comment = home directories
browseable = No
writable = yes
Create mode = 0755
Force Create mode = 0755
Directory mode = 0755
force directory mode = 0755
; Valid users =%s
; Valid users = mydomain\%s
Workgroup = www
NetBIOS name = www
Path =/home/share
browseable = yes
writeable = yes

Service SMB Restart

The [home] directory is a personal directory of each Samba account, which is the personal directory under/home, which is the corresponding mount directory for each account;
[Share] is a shared directory.
Briefly describe the implications of these parameters:

Create mode– This configuration defines the properties of the newly created file. When Samba creates a new file, it maps the permissions of the DOS file to the corresponding UNIX permissions, and the permissions that are derived after the mapping are manipulated with the values defined by this parameter. The following force create mode is then performed or manipulated to obtain file permissions under Final Linux.
Force create mode– See the above description. The permission bits that are set for this parameter must appear in the file properties.
Directory mode– This configuration is similar to the Create mode parameter, except that it is applied to the newly created directory. When Samba creates a new directory, it dos–>linux the mapped file attributes to the values defined by this parameter, then to force directory mode, and then sets the directory properties by this value.
Force directory mode– See the above description. The equivalent of the permission bits set in this parameter must appear in the properties of the directory.
Note that the above create mode and create mask parameters are synonyms, which can be used, and the directory mode and directory mask parameters are the same.

Create account:

Useradd Zhangsan
passwd Zhangsan
Chmod-r 0755/home/zhangsan
Smbpasswd-a Zhangsan Create Samba account
Service SMB Reload
Test Samba shortcut windows (Start key) +r Enter the \\samba server address in the box that pops up and enter the account password as shown in the following figure: successful configuration

To map a disk drive:

Map succeeded

5. Configure Apache

Edit Apache configuration file httpd.conf add

VI httpd.conf
Add a profile in the/usr/local/apache/conf/vhost directory
VI test.data.house.sina.com.cn.conf
Add the following content
<virtualhost *:88>
ServerName test.house.sina.com.cn
#ServerAlias localhost
DirectoryIndex index.php index.html index.htm
Options +includes-indexes
AllowOverride All
Order Deny,allow
Allow from all
Php_admin_value Open_basedir/home/yangyi/test.house.sina.com.cn:/tmp:/proc

Restart Apache

Service httpd Restart

Add DNS resolution locally test.house.sina.com.cn

Add a test file to the Map directory creation folder as follows:

Build Configuration Success!

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.