ubuntu10.04 Building PHP Development Environment Summary

Source: Internet
Author: User
Tags php development environment ubuntu package manager hosting web hosting
ubuntu10.04 Building PHP Development Environment Summary
1. Installing UltraISO
2. Update the source
3. Drive, Load Drive
4. System optimization tweak and boot sequence, GFW
5. Installation of integrated development environment and environment configuration

1. Install Ubuntu
Using UltraISO to make a U-disk Ubuntu Startup disk
2. Update Ubuntu source
Can search the Ubuntu source list on the Internet to add to the/etc/apt/sources.list
3.1ubuntu with the system tools available to update the driver
3.2 Auto Mount HDD------http://blog.csdn.net/free2011/archive/2010/03/17/5389965.aspx
View hard disk information: sudo fdisk-l
Edit Fstab
#
1. 。 This is used to specify the device name or block information of the file system you want to mount, or it can be a remote file system. Friends who have done embedded Linux development may know the meaning of the Mount 192.168.1.56:/home/nfs/mnt/nfs/-o nolock (which can be other IP) commands. Its task is to mount the/home/nfs/directory on the remote host with IP 192.168.1.56 to the/MNT/NFS/directory on this machine. If you want to write it into the/etc/fstab file, this part of the filesystem system should be filled in as:/192.168.1.56:/home/nfs/.
If you want to mount a device on this machine, such as:/DEV/SDA1,/dev/hda2, or/dev/cdrom, where/dev/sda1 represents the first partition of the first serial drive, or the first partition of the first SCSI hard disk,/ DEV/HDA1 represents the first partition of the first IDE hard disk, and/dev/cdrom represents the optical drive.
In addition, the label (volume label) or UUID (universally unique identifier globally unique identifier) can also be represented. Before you use a label, you e2label create a volume label, such as: e2label/dir_1/dir_2, which means to use/dir_2 to represent the name of the/dir_1. Then, add it under/etc/fstab: label=/dir_2/dir_2 。 After reboot, the system will mount the/dir_1 to the/dir_2 directory. For UUID, it can be obtained by Vol_id-u/dev/sdax. For example, I want to mount the first partition of the first hard drive, first with the command vol_id-u/dev/sda11 to get the UUID, for example: 5dc08a62-3472-471b-9ef5-0a91e5e2c126, and then in This field fills in: uuid=5dc08a62-3472-471b-9ef5-0a91e5e2c126, can represent/DEV/SDA11. Red Hat Linux generally uses labels, while Ubuntu Linux uses UUID.
2. 。 Mount point, which is to find one yourself or create a dir (directory), and then put the file system To this directory, then you can access it from this directory to mount the file system. For a swap partition, this field should be filled in: none, indicating no mount point.
3. 。 This is used to specify the type of file system. The following file systems are currently supported by Linux: ADFS, BEFs, CIFS, ext3, ext2, ext, iso9660, Kafs, Minix, Msdos, VFAT, Umsdos, Proc, ReiserFS, swap, SQUASHFS, NFS, HPFS, NCPFS, NTFS, affs, UFS. Auto indicates that the file system type will be automatically detected.
4. 。 This is used to fill in the setup options, with each option separated by commas. But here's a very important keyword to look at: defaults, which represents the option Rw,suid,dev,exec,auto,nouser and async.
Various explanations
Auto and Noauto: This is the option to control whether the device is automatically mounted. Auto is the default option, so the device is automatically mounted when you start or when you use the Mount-a command, as Fstab. If you do not want this, use the Noauto option, and if so, you can only explicitly mount the device by hand.
User and Nouser: This is a very useful option, the user option allows a normal user to mount the device, while the Nouser only allows the root user to mount. Nouser is the default option, which is also a headache for many Linux novices, because they found no way to mount the CD-ROM, Windows partition, etc. properly. If you have a similar problem or other problem as a normal user, please add the user attribute to Fstab.
EXEC and noexec:exec allow you to execute the executable binaries in the corresponding partition, so the noexec works just the opposite. You can use the Noexec property if you have a partition that has executable programs on the partition that you do not want, or do not execute on your system. This situation occurs when the Windows partition is mounted. EXEC is the default option for the simple reason that if noexec becomes the default option for your/root partition ...
RO: Mount the file system as read-only. 54ne.com
RW: Mount the system with a readable and writable property.
China Network Management Alliance www, BITSCN, com
Sync and Async: How the input and output of the file system should be done. Sync means synchronization is done, in layman's words, when you copy a thing into a device or partition, all the write changes will take effect as soon as you enter the CP command, which should start to copy the device or partition immediately. In the case of async, which is the asynchronous completion of the input and output, when you copy a thing into a device or partition, it may take a long time after you hit the CP command, the actual write operation will be executed, in other words, the buffer is processed.
5. 。 Here is 1, which means the entire The content backup in 0, which means no backup. The dump tool is rarely used now, and is typically selected here in 0.
6. 。 This is used to specify how FSCK can be used to check the hard disk. If you fill 0 here, then do not check, the mount point is/(that is, the root partition), must be filled in here 1, the other can not fill 1. If there is more than 1 of the partition fill, then after the root partition is checked, and then the number of completed from small to large in order to check down. Check with the same number. For example, the first and second partitions fill in 2, and the third and fourth partitions fill 3, then the system checks the first and second partitions at the same time after the root partition is checked, and then checks the third and fourth partitions at the same time.
4.1 Install the tweak with the sudo apt-get installation tweak command
4.2 Boot order------http://www.ubuntuhome.com/ubuntu10-04-grub.html
After installing Windows, and then installing Ubuntu, after booting, the GRUB multiple boot default entry is Ubuntu, if the main operating system used is Ubuntu, but if the main operating system is windows, it is obviously not very convenient
The following methods are used to modify the boot order of grub under Ubuntu10.04:
sudo gedit/boot/grub/grub.cfg
Set default= "0″ modified to set default=" 4″
default= "0″ After the value 0 is the first selection, if you change to 1, 2, 3, 4, respectively, the default startup selection is placed on the 第二、三、四、五个 selection
Find timeout= "10″ after the number 10 means that the default countdown to select the boot bar is 10 seconds, of course, this value can be changed to a larger, such as 20, 30 or something, but if the value is changed to negative 1, that is" 1 ", when the boot to see the grub selection without a countdown, Until you select the boot bar you want to start and enter to enter the system
Modify save, restart on it.
In some early versions of Ubuntu, there are several ways to modify the boot order of grub:
The configuration file is not in Grub.cfg, but in Menu.lst
The method of modification is basically the same, the main is to modify the default and timeout two, the other can do their own preferences to do some customization


Installation of the 5.1PHP integrated development environment
In Ubuntu Package Manager-edit-Install lamp with Task Group tag package and install phpMyAdmin
Configuration of the 5.2PHP integrated development environment-------http://www.guanwei.org/post/LINUXnotes/01/ubuntuapache2configure.html

Under Windows, Apache usually has only one configuration file, which is httpd.conf. But after I installed the Apache2 with the Apt-get install apache2 command on Ubuntu Linux, I found that its httpd.conf (located in the/etc/apache2 directory) was empty! And then found that the Ubuntu Apache software package configuration file is not as simple as windows, it put the individual settings in different configuration files, look complex, but think carefully about the design is really reasonable.
Strictly speaking, Ubuntu Apache (or should say Linux under the Apache?) I am not sure that the configuration file for other distributions of the Apache package is that/etc/apache2/apache2.conf,apache automatically reads the configuration information for this file at startup. Some other configuration files, such as httpd.conf, are included through the include directive. These include lines can be found in apache2.conf:
# Include Module Configuration:
Include/etc/apache2/mods-enabled/*.load
Include/etc/apache2/mods-enabled/*.conf

# Include All the user configurations:
Include/etc/apache2/httpd.conf

# Include Ports Listing
Include/etc/apache2/ports.conf
......
# Include Generic snippets of statements
include/etc/apache2/conf.d/

# Include The virtual host configurations:
include/etc/apache2/sites-enabled/
Combined with annotations, you can clearly see the general effect of each configuration file. Of course, you can put all the settings in apache2.conf or httpd.conf or any configuration file. This division of Apache2 is only a good habit.
One of the most important things to do after installing Apache is to know where the Web document root directory is, and for Ubuntu, the default is/var/www. How do you know that? There is no documentroot in apache2.conf, httpd.conf is empty, so it must be in other files. After searching, found in the/etc/apache2/sites-enabled/000-default, there is such content:
Namevirtualhost *

ServerAdmin [email protected]

documentroot/var/www/
......
This is setting up the virtual host, which means nothing to me. So I put the apache2.conf in the include/etc/apache2/sites-enabled/line commented out, and in httpd.conf set documentroot for my user directory under a directory, so as to facilitate the development.

And look at what's in the/etc/apache2 directory. Just found in the apache2.conf sites-enabled directory, and/etc/apache2 under a sites-available directory, what is put in it? In fact, this is the real configuration file, and the sites-enabled directory is just some of the files pointing to the symbolic link here, you can use ls/etc/apache2/sites-enabled/to confirm. Therefore, if more than one virtual host is configured on Apache, and the configuration file of each virtual host is placed under Sites-available, it is very convenient for the virtual host to be deactivated and enabled: When a link to a virtual host profile is established under sites-enabled , it is enabled, and if you want to turn off a virtual host, simply delete the link and not change the configuration file at all.

======================================================
Mods-available, mods-enabled, and the above-mentioned sites-available, sites-enabled, these two directories are the configuration files and links that store the Apache function module. When I installed the PHP module with apt-get install PHP5, there were php5.load, php5.conf, and links to the two files in both directories. This catalog result is very handy for enabling and deactivating an Apache module.
The last one to say is ports.conf, which sets the port that Apache uses. If you need to adjust the default port settings, it is recommended that you edit this file. Or if you think it is superfluous, you can first remove the include/etc/apache2/ports.conf line in the apache2.conf and set the Apache port in the httpd.conf.
The default installed directory structure in Ubuntu is a bit different. In Ubuntu, the module and virtual host configuration has two directories, one is available, one is the enabled,available directory is a valid content, but it does not work, only with LN to enable the past can work. It is easy to use for debugging, but if you do not know beforehand, it is a bit troublesome to find it.
/etc/apache2/sites-available is in the VH configuration, but it does not work, to link the file to the sites-enabled directory.
Namevirtualhost

ServerName Domain Name
DocumentRoot the public in the Rails project as the root directory

Options execcgi FollowSymLinks
AllowOverride All
Allow from all
Order Allow,deny

errorlog/var/log/apache2/error-domain name. log


====================================================
What is virtual Hosting (web hosting)?
Simply put, the same server can handle more than one domain name at a time. Assuming that both www.example1.net and www.example2.net have two domain names pointing to the same server, and the Web server supports virtual Hosting, Then www.example1.net and www.example2.net can access different web spaces on the same server (the site file directory).
Configuration format
In Apache2, valid site information is stored in the/etc/apache2/sites-available/user name (file). We can add a valid virtual space by adding information in the following format:

# Add your website name after servername
ServerName www.linyupark.com
# If you want multiple site names to get the same site, you can add additional site aliases after Serveralias.
# aliases are separated by a space.
Serveralias ftp.linyupark.com mail.linyupark.com
# after the serveradmin with the webmaster's e-mail address, convenient for others to have a problem is to contact the webmaster.
ServerAdmin [email protected]
# after DocumentRoot, add the directory path (user's personal directory) to store the contents of the website.
Documentroot/home/linyupark/public_html

Options Indexes followsymlinks MultiViews
AllowOverride None
Order Allow,deny
Allow from all

scriptalias/cgi-bin//usr/lib/cgi-bin/

AllowOverride None
Options execcgi-multiviews +symlinksifownermatch
Allow from all

Errorlog/home/linyupark/public_html/error.log
# Possible values Include:debug, info, notice, warn, error, crit,
# Alert, Emerg.
LogLevel warn
Customlog/home/linyupark/public_html/access.log combined
Serversignature on

If your server has more than one IP, and the different IP has the same virtual user, can be modified to:

...

Enable configuration
The previously configured content is only "effective" virtual host, the actual effect of the words must be placed under the/etc/apache2/sites-enabled folder. We can use the LN command to create a pair of associated files:
sudo ln-s/etc/apache2/sites-available/linyupark/etc/apache2/sites-enabled/linyupark
Check syntax, restart Web service
As a precaution, we check the syntax before restarting the service:
sudo apache2ctl configtest
If there are no errors, then restart Apache.
Sudo/etc/init.d/apache2-k restart
View Effects
The main setup work has been completed, it is simple ^_^. How do you see the effect?
Also simple, as long as the host (I use XP) in the table of the host to change the line. The address is:
Windows\system32\drivers\etc
Open and add a sentence:
192.168.1.22 www.linyupark.com
The effect is that the browser input www.linyupark.com will go directly to the IP 192.168.1.22 server to receive the request, see if there is a compatible virtual host domain name, some words to the corresponding directory of the Web file to the requesting user

----------------------------------------

One NIC binds multiple IPs, then sets up multiple virtual hosts

----------------------------------------

Modify/etc/network/interfaces
Auto Eth0:1
Iface eth0:1 inet Static
Address 192.168.10.37
Netmask 255.255.255.0
Network 192.168.10.1
Broadcast 192.168.10.255

Http://blog.chinaunix.net/u/5948/showart_454495.html
Setting up a virtual host allows you to set up multiple virtual hosts in Apache

But to restart the network card: sudo/etc/init.d/networking restart

-------------------------------------------

GFW

-------------------------------------------



Reference: http://hi.baidu.com/%CE%B0%CE%B0%D0%A1%CE%D1/blog/item/0802884e0776a43bafc3ab98.html

Registered website: http://www.cjb.net/cgi-bin/shell.cgi?action=signup



One, need a remote host login account, click here to register an account for free, this site registration is very simple, I use the feeling of speed or very fast to. After you receive the reply message, follow the prompts to activate your account, and then you will receive a second message that tells you the server name, account number, password, as follows:
Hostname:shell.cjb.net
Username: ************
Password: ************
Second, install a Firefox plugin--autoproxy, this plugin can help you to automatically determine which sites need to GFW, which sites do not need. After installing the plugin, you will be prompted to subscribe to the GFW list, which records the site address of the wall.
Then set up this software, in the Firefox status bar, there is a "blessing" word to the icon, click to enter the settings, in the "Proxy Server" menu item click on "Select Proxy Server" one:

The default main agent is Tor, which is changed to ssh-d:
Third, modify the agent DNS settings of Firefox, and then enter About:config in the browser address column, and then appear
Select "I promise to be careful" and enter in the filter
Network.proxy.socks_remote_dns, as shown in:
Next, double-click on the item that appears below, and you will find that it has turned to true for the value:
In this way, Firefox setup is complete.
Iv. log in to the remote server:
sudo ssh-qtfnn-d 7070 [email protected]
Then enter Yes:
Then enter your password and you're done. Below, take a look at the world outside the wall:
---------------------------------------------------------

Turn off the Touchpad

---------------------------------------------------------

sudo modprobe psmouse turn on touch pad

sudo modprobe-r psmouse turn off touch pad

sudo apt-get install swfdec-gnome add SWF playback

-------------------------------------------------------------

Solve the problem of garbled PDF in Chinese

-------------------------------------------------------------

sudo apt-get install xpdf-chinese-simplified

sudo apt-get install xpdf-chinese-traditional

sudo apt-get install Poppler-data

sudo rm/etc/fonts/conf.d/49-sansserif.conf

Build SVN Server Installation Subversion
#apt-get Install Subversion
New Storage Warehouse
#mkdir/home/svnrepos
#svnadmin Create/home/svnrepos/testproject
Modify Configuration
#cd/home/svnreos/testproject/conf
#vim svnserve.conf
Uncomment the following lines:
Anon-access = Read #匿名用户权限 (read,write,none)
auth-access = Write #认证用户权限 (read,write,none)
Password-db = passwd #用户账户管理 (passwd is the file name, relative path is used here)
#vim passwd
Add SVN user
Svnuser = password #指定 (user name = password)
Import Project
If the project is in the/opt/testproject directory
#svn import–m "My testproject imported"/opt/testproject File:///home/svnrepos/TestProject
Prompt version after submission is 1
Start the SVN server
#svnserve –d–r/home/svnrepos--listen-host 172.31.134.100 (Your Ip Addr)
Note: Here Svnrepos cannot have/, new version of SVN need to replace--listen-host 172.31.134.100 to--listen-port 3690)
-D: Running in the background
-r: Specify the SVN server root directory
--listen-host: Specify the Listening IP
Test SVN
Use Svn://172.31.134.100/testproject on other machines
User name: svnuser Password: password
Access to the SVN service.

Appendix A starts the SVN service automatically
In the/ETC/INIT.D directory, thanks to a script svnd.sh, the contents are as follows:
#!/bin/bash
/usr/bin/svnserve-d-r/home/svnrepos
Then execute:
#update-RC.D svnd.sh Defaults
#chmod 777/etc/init.d/svnd.sh

1/F Xiaoshenge 2011-02-22

Host name-based virtual host:
1. Bind the domain name in/etc/hosts, multi-domain binding the same IP
Configuration of default in 2.sites-avaliable:
NameVirtualHost192.168.1.21

ServerName www.mycake.com
Serveralias mycake.com
documentroot/mnt/g/www/phptest/cakephp

Options Indexes followsymlinks MultiViews
AllowOverride None
Order Allow,deny
Allow from all

Errorlog ${apache_log_dir}/mycake-error.log

# Possible values Include:debug, info, notice, warn, error, crit,
# Alert, Emerg.
LogLevel warn

Customlog ${apache_log_dir}/mycake-access.log combined


ServerName www.iseeuo.com
Serveralias iseeuo.com
Documentroot/mnt/g/www/runya/iseeuo.com

Options Indexes followsymlinks MultiViews
AllowOverride None
Order Allow,deny
Allow from all

Errorlog ${apache_log_dir}/iseeuocom-error.log

# Possible values Include:debug, info, notice, warn, error, crit,
# Alert, Emerg.
LogLevel warn

Customlog ${apache_log_dir}/iseeuocom-access.log combined

2/F Xiaoshenge 2011-02-22

Virtual Host configuration in XP:
1.c:/windows/system32/drivers/etc/hosts
2.
Namevirtualhost 192.168.1.88

ServerName www.iseeuo.com
DocumentRoot d:/wamp/www/iseeuo.com


Options Indexes FollowSymLinks
Order Deny,allow
Allow from all

  • 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.