Ubuntu10.04 summary of building a PHP development environment

Source: Internet
Author: User
Tags php development environment ubuntu package manager
Ubuntu10.04 build a PHP development environment summary 1. install ultraiso2. update source 3. attach the hard disk 4. the system optimizes the tweak and startup sequence. GFW5. install the integrated development environment and environment configuration. 1. install ubuntu and use ultraiso to create a USB flash drive for ubuntu 2. update ubuntu Source. you can search for ubuntu source list on the internet. ubuntu10.04 build a PHP development environment summary.
1. install ultraiso
2. update source
3. install the drive and load the hard disk
4. the system optimizes the tweak and startup sequence. GFW
5. install the integrated development environment and environment configuration

1. install ubuntu
Use ultraiso to create a USB disk ubuntu boot disk
2. update the ubuntu source
You can search for the ubuntu source list on the Internet and add it to/etc/apt/sources. list.
3.1ubuntu has built-in system tools to update the driver
3.2 auto Mount hard drive ------ http://blog.csdn.net/free2011/archive/2010/03/17/5389965.aspx
View hard disk information: sudo fdisk-l
Edit fstab
#
1, . It is used to specify the device name or block information of the file system to be mounted, or remote file system. Anyone who has developed an embedded linux system may know the significance of the mount 192.168.1.56:/home/nfs/mnt/nfs/-o nolock (which can be other IP addresses) command. Its task is to mount the/home/nfs/directory on the remote host whose IP address is 192.168.1.56 to the/mnt/nfs/directory on the local machine. If you want to write it into the/etc/fstab file, enter/192.168.1.56:/home/nfs/as the file system /.
If you want to mount a device on the local machine, write the following statements:/dev/sda1,/dev/hda2, or/dev/cdrom, /dev/sda1 indicates the first partition of the first serial hard disk or the first partition of the first SCSI hard disk./dev/hda1 indicates the first partition of the first IDE hard disk, /dev/cdrom indicates the optical drive.
In addition, it can be represented by a label (volume label) or UUID (globally Unique Identifier of a universal Unique Identifier. Before using a label, you must first create an e2label, for example, e2label/dir_1/dir_2, which means/dir_2 is used to represent the name of/dir_1. Then, add LABEL =/dir_2/dir_2 under/etc/fstab. . After the restart, the system will mount/dir_1 to the/dir_2 directory. You can use vol_id-u/dev/sdax to obtain the UUID. For example, to mount the first partition of the first hard disk, run vol_id-u/dev/sda11 to obtain the UUID, for example, 5dc08a62-4402-471b-9ef5-0a91e5e2c126. Enter UUID = 5dc08a62-4872-471b-9ef5-0a91e5e2c126 in this field to indicate/dev/sda11. Red Hat linux generally uses label, while Ubuntu linux generally uses UUID.
2, . Mount point, that is, find one or create a dir (directory), and then Then, you can access the file system to be mounted from this directory. For swap partitions, enter none in this field, indicating that no mount point exists.
3, . The file system type is specified here. 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 and ufs. Auto indicates that the file system type will be automatically detected.
4, . The setting options are used here. each option is separated by a comma. However, here is a very important keyword to understand: defaults, which contains options rw, suid, dev, exec, auto, nouser, and async.
Details
Auto and noauto: This option controls whether devices are automatically mounted. Auto is the default option. in this way, the device is automatically mounted according to the fstab content when it is started or you use the mount-a command. If you do not want this, use the noauto option. in this case, you can only manually mount the device.
User and nouser: this is a very useful option. the user option allows common users to mount devices, while the nouser option only allows root users to mount devices. Nouser is the default option, which is also a headache for many new Linux users, because they find that there is no way to mount the optical drive and Windows partition normally. If you encounter similar problems or other problems as a common identity user, add the user attribute to fstab.
Exec and noexec: exec allow you to execute executable binary programs in the corresponding partition. Likewise, noexec has the opposite effect. If you have a partition and some executable programs on the partition, you can use the noexec attribute if you don't want them, or you cannot execute them in your system. This often happens when Windows partitions are mounted. Exec is the default option. The reason is very simple. if noexec becomes the default option for your/root partition ......
Ro: Mount the file system in read-only mode. 54ne.com
Rw: Mount the system with readable and writable attributes.
China Network Management Alliance www, bitsCN, com
Sync and async: How should input and output of the file system be completed. Sync means that synchronization is completed. In other words, when you copy something to a device or partition, all write changes will take effect immediately after you enter the cp command, this should be copied to the device or partition immediately. If async is used, that is, asynchronous input and output, when you copy an East-West device or partition, it may take a long time after you press the cp command, the actual write operation is executed. In other words, it is buffered.
5, . If this parameter is set to 1 If the value is 0, the backup is not performed. Currently, dump is rarely used. Select 0 here.
6, . It is used to specify how to use fsck to check the hard disk. If this field is set to 0, no check is performed. if the mount point is/(root partition), 1 must be entered here, and none of the other fields can be set to 1. If the number of partitions is greater than 1, after checking the root partition, check the number from small to large. Check the number at the same time. For example, enter 2 for the first and second partitions, 3 for the third and fourth partitions, and then check the first and second partitions after checking the root partitions, check the third and fourth partitions at the same time.
4.1 Use the sudo apt-get install tweak command to install tweak
4.2 boot sequence------ http://www.ubuntuhome.com/ubuntu10-04-grub.html
After Windows is installed, and then Ubuntu is installed. after it is started, grub enters Ubuntu by default after multiple boot operations. if the main operating system is Ubuntu, however, if the main operating system is Windows, it is obviously not very convenient.
The following describes how to modify the grub boot sequence in Ubuntu10.04:
Sudo gedit/boot/grub. cfg
Set default = "0" to set default = "4 ″
The value 0 after default = "0" is the first option. if it is changed to 1, 2, 3, and 4, set the default Startup options to the options 2, 3, 4, and 5 respectively.
If the value 10 after "timeout =" 10 "is found, the default countdown value of the guide bar is 10 seconds. of course, this value can be larger, such as 20 or 30, however, if you change the value to negative 1, that is, "-1", there is no countdown when you see the grub option at boot, until you select the boot entry to be started and press enter to enter the system.
Save the modification and restart the instance.
In some earlier versions of Ubuntu, the following describes how to modify the grub boot sequence:
The configuration file is not in grub. cfg, but in menu. lst.
The modification method is basically the same, mainly to modify the default and timeout items. others can customize their own preferences.


5.1install PHP integrated development environment
Install LAMP in the ubuntu package manager-edit-use the task group tag package, and install phpmyadmin
5.2PHP integrated development environment configuration------- http://www.guanwei.org/post/LINUXnotes/01/ubuntuapache2configure.html

In Windows, there is usually only one configuration file for Apache, that is, httpd. conf. However, after I installed apache2 with the apt-get install Apache2 command in Ubuntu Linux, I found that its httpd. conf (in the/etc/apache2 directory) is empty! It is found that the configuration file of the Apache package in Ubuntu is not as simple as that in Windows. it divides the configuration items into different configuration files and looks complicated, but think about the design carefully.
Strictly speaking, the Apache of Ubuntu (or the Apache under Linux? The configuration file of other apache software packages is/etc/apache2/apache2.conf. Apache automatically reads the configuration information of this file at startup. Some other configuration files, such as httpd. conf, are included through the Include command. You can find these Include rows in apache2.conf:
# Include module configuration:
Include/etc/apache2/mod-enabled/*. load
Include/etc/apache2/mod-enabled/*. conf

# Include all the user invocations:
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/
With comments, you can clearly see the general functions of each configuration file. Of course, you can put all the settings in apache2.conf, httpd. conf, or any configuration file. This classification of Apache2 is just a good habit.
The most important thing after installing Apache is to know where the Web document root directory is. for Ubuntu, the default value is/var/www. How do you know? There is no DocumentRoot entry in apache2.conf, and httpd. conf is empty, so it must be in other files. After searching, it is found that the content in/etc/apache2/sites-enabled/000-default contains the following content:
NameVirtualHost *

ServerAdmin webmaster @ localhost

DocumentRoot/var/www/
......
This is for setting up a VM, which is meaningless to me. So I commented out the Include/etc/apache2/sites-enabled/line in apache2.conf and added it to httpd. in conf, set DocumentRoot to a directory under my user directory to facilitate development.

Let's take a look at the things in the/etc/apache2 directory. I just found the sites-enabled Directory in apache2.conf, and there is a sites-available directory under/etc/apache2. what is the content here? In fact, this is the real configuration file, and the sites-enabled Directory stores only some symbolic links pointing to the files here, you can use ls/etc/apache2/sites-enabled/to confirm it. Therefore, if multiple virtual hosts are configured on apache and the configuration files of each virtual host are stored in sites-available, it is very convenient to disable and enable the virtual host: when a link is established under sites-enabled to a virtual host configuration file, it is enabled. to disable a virtual host, you only need to delete the corresponding link, you do not need to modify the configuration file.

========================================================== ====================
The following two directories are used to store the configuration files and links of the apache function module. After I installed the PHP module with apt-get install php5, php5.load, php5.conf, and links to these two files are available in these two directories. This directory result is very convenient for enabling or disabling an Apache module.
The last one is ports. conf, where the port used by Apache is set. To adjust the default port settings, we recommend that you edit this file. Alternatively, you can remove the Include/etc/apache2/ports. conf line in apache2.conf and set the Apache port in httpd. conf.
The default directory structure installed in ubuntu is quite different. In ubuntu, the module and virtual host configurations both have two directories: available, enabled, and available. the available directory stores valid content but does not work, it takes effect only when ln is connected to enabled. Debugging is easy to use, but if you do not know it beforehand, it will be a little troublesome to find it.
The/etc/apache2/sites-available file is configured with the link-to-enabled file but does not work. you must link the file to the sites-enabled Directory.
NameVirtualHost

ServerName domain name
DocumentRoot treats 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 )?
Simply put, the same server can process more than one domain at the same time ). Assume that both www.example1.net and www.example2.net point to the same server, and WEB servers support Virtual Hosting. then www.example1.net and www.example2.net can access different WEB spaces (website file storage directory) on the same server ).
Configuration format
In Apache2, all valid site information is stored in/etc/apache2/sites-available/user name (file. We can add the following information to add a valid virtual space:

# Add your website name after ServerName
ServerName www.linyupark.com
# If you want to obtain the same website name for multiple websites, add another website alias after ServerAlias.
# Aliases are separated by spaces.
ServerAlias ftp.linyupark.com mail.linyupark.com
# Add the email address of the website administrator after ServerAdmin to contact the website administrator if any problem occurs.
ServerAdmin webmaster@linyupark.com
# Add the directory path for storing website content after DocumentRoot (user's personal directory)
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 multiple IP addresses and different IP addresses have different virtual users, you can change them:

...

Enable configuration
The content we configured above is only "valid" virtual host. if it works, put it in 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 the syntax and restart the web service.
To be cautious, check the syntax before restarting the service:
Sudo apache2ctl configtest
If no error occurs, restart Apache.
Sudo/etc/init. d/apache2-k restart
View Results
The main setting has been completed. it's still easy. ^_^. What is the effect?
It is also simple. you only need to modify the Host table on the Host (XP is used. The address is:
WINDOWS \ system32 \ drivers \ etc
After opening, add the following sentence:
192.168.1.22 www.linyupark.com
In the browser, enter www.linyupark.com and go to the IP address 192.168.1.22 server to receive the request. check whether the domain name of the VM is correct. If yes, the WEB file in the corresponding directory is displayed to the requesting user.

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

One Nic is bound to multiple IP addresses, and multiple virtual hosts are configured.

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

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
After setting a VM, you can set multiple VM instances in apache.

However, restart the NIC: sudo/etc/init. d/networking restart

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

GFW

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



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

Registration URL: http://www.cjb.net/cgi-bin/shell.cgi? Action = signup



1. a remote host login account is required. Click here to register an account for free. The website registration is very simple. I feel that the speed is quite fast. After receiving the reply email, follow the prompts to activate the account, and then you will receive the second email, telling you the server name, account, and password, as shown below:
Hostname: shell.cjb.net
Username :************
Password :************
2. install a firefox plug-in, AutoProxy, which can help you automatically determine which websites need GFW and which do not. After installing the plug-in, you will be prompted to subscribe to the gfw list, which records the website address of the wall.
Next, set the software. in the status bar of firefox, there is a "fu" to the icon, and click it to enter the settings, in the "proxy server" menu, click "select proxy server:

The default master proxy is Tor, and you just need to change it to ssh-D:
3. modify the proxy DNS settings of firefox and enter "about: config" in the browser address column.
Select "I promise to be careful", and then input it in the filter.
Network. proxy. socks_remote_dns, as shown in:
Next, double-click the item shown below and you will find that the value has changed to true:
In this way, firefox settings are complete.
4. log on to the remote server:
Sudo ssh-qTfnN-D 7070 username @ shell.cjb.net
Then enter yes:
Then enter your password. Next, let's take a look at the world of NLP:
---------------------------------------------------------

Close TouchPad

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

Sudo modprobe psmouse enable TouchPad

Sudo modprobe-r psmouse close TouchPad

Sudo apt-get install swfdec-gnome add swf play

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

Solve Chinese garbled pdf

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

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

Set up svn server and install Subversion
# Apt-get install subversion
Create a storage warehouse
# Mkdir/home/svnrepos
# Svnadmin create/home/svnrepos/TestProject
Modify configurations
# Cd/home/svnreos/TestProject/conf
# Vim svnserve. conf
Uncomment the following lines:
Anon-access = read # Anonymous user permissions (read, write, none)
Auth-access = write # authenticate user permissions (read, write, none)
Password-db = passwd # User account management (passwd is the file name and the relative path is used here)
# Vim passwd
Add svn user
Svnuser = password # specify (username = password)
Import project
Assume that the project is in the/opt/TestProject Directory
# Svn import-m "My TestProject Imported"/opt/TestProject file: // home/svnrepos/TestProject
After submission, the prompt version is 1.
Start SVN server
# Svnserve-d-r/home/svnrepos -- listen-host 172.31.134.100 (Your Ip Addr)
Note: The svnrepos cannot be followed by/. in the new version of svn, replace -- listen-host 172.31.134.100 with -- listen-port 3690)
-D: run in the background
-R: specifies the svn server root directory.
-- Listen-host: specifies the IP address of the listener.
Test SVN
Use svn: // 172.31.134.100/TestProject on other machines
Username: svnuser password: password
Access the svn service.

Appendix A automatically start the svn service upon startup
In the/etc/init. d Directory, add a script svnd. sh with the following content:
#! /Bin/bash
/Usr/bin/svnserve-d-r/home/svnrepos
Then execute:
# Update-rc.d svnd. sh defaults
# Chmod 777/etc/init. d/svnd. sh
Host Name-based VM on the host name on the first floor of xiaoshenge 2011-02-22:
1. bind a domain name to/etc/hosts and bind multiple domain names to the same IP address
2. default configuration in 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

Customlogs $ {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

Customlogs $ {APACHE_LOG_DIR}/iseeuocom-access.log combined
Virtual host configuration in xp on the second floor of xiaoshenge 2011-02-22:
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.