Tuesday, July 27, 2010

Install MySQL, PHP, Apache in Ubuntu 9-10

Install MySQL, PHP, Apache in Ubuntu 9-10
Mysql Only:
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get install mysql-server mysql-client
$ sudo mysqladmin -u root -h localhost password 'mypassword'
$ sudo mysqladmin -u root -h myhostname password 'mypassword'
Now, you probably don't want just the MySQL Server. Most likely you have Apache+PHPalready installed, and want MySQL to go with that. Here are some libraries you need to install to make MySQL available to PHP:
sudo apt-get install php5-mysql
Or for Ruby:
$ sudo apt-get install libmysql-ruby
You can now access your MySQL server like this:
$ mysql -u root -p
---------------------------------------
Apache + PHP + Mysql + MySQLite + Mongrel
$ sudo apt-get install apache2 mysql-server
$ sudo apt-get install libapache2-mod-auth-mysql
$ sudo apt-get install libapache2-mod-php5 php5-mysql
$ sudo apt-get install mongrel


Install SQLite:
$ sudo apt-get install php5-sqlite
$ sudo apt-get install phpmyadmin


---------------------------------------
Apache Document Root
$ /var/www/

Apache Configuration file:
$ /etc/apache2/apache2.conf
$ /etc/apache2/sites-available/default

MySQL Configuration file:
$ /etc/mysql/my.cnf

PHP configuration file:
$ /etc/php5/apache2/php.ini
PHPMyAdmin
$ /etc/phpmyadmin/apache.conf
---------------------------------------

Monday, July 26, 2010

Ubuntu Desktop 9-10 Change network setup from DHCP to Static

To change your network configuration from dhcp to static ip is not hard. You can follow these steps below:
1. Open your terminal client
2. Type this command:
$ sudo vim /etc/interfaces
3. Then you will see there are 2 network interface, lo and eth0. See example below:
auto lo
iface lo inet loopback
 
auto eth0
iface eth0 inet dhcp
4. Change the eth0 one according to your network setting (you can call your network administrator and tell you the setting) , see example below
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
5. Save that file and close
6. Restart your network to apply the new setting, with this command:
$ /etc/init.d/networking restart
7. See your network configuration by type:
$ ifconfig
That's it. Thanks for reading this article. Please leave any comment if you have another tips or input.