Xtreme Network Solutions

Archive for June, 2010

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 10.04 (LAMP)

by on Jun.22, 2010, under Ubuntu

I use the hostname server1.example.com with the IP address 192.168.0.100. These settings might differ for you, so you have to replace them where appropriate.

I’m running all the steps in this with root privileges, so make sure you’re logged in as root:

sudo su

Installing MySQL 5

First we install MySQL 5 like this:

aptitude install mysql-server mysql-client

You will be asked to provide a password for the MySQL root user – this password is valid for the user root@localhost as well as root@server1.example.com, so we don’t have to specify a MySQL root password manually later on:

New password for the MySQL “root” user: <-- yourrootsqlpassword
Repeat password for the MySQL "root" user: <-- yourrootsqlpassword

Installing Apache2

Apache2 is available as an Ubuntu package, therefore we can install it like this:

aptitude install apache2

Now direct your browser to http://192.168.0.100, and you should see the Apache2 placeholder page (It works!):

Apache’s default document root is /var/www on Ubuntu, and the configuration file is /etc/apache2/apache2.conf. Additional configurations are stored in subdirectories of the /etc/apache2 directory such as /etc/apache2/mods-enabled (for Apache modules), /etc/apache2/sites-enabled (for virtual hosts), and /etc/apache2/conf.d.

Installing PHP5

We can install PHP5 and the Apache PHP5 module as follows:

aptitude install php5 libapache2-mod-php5

We must restart Apache afterwards:

/etc/init.d/apache2 restart

Testing PHP5 / Getting Details About Your PHP5 Installation

The document root of the default web site is /var/www. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

vi /var/www/info.php

phpinfo();
?>

Now we call that file in a browser (e.g. http://192.168.0.100/info.php):

Getting MySQL Support In PHP5

To get MySQL support in PHP, we can install the php5-mysql package. It’s a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:

aptitude search php5

Pick the ones you need and install them like this:

aptitude install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json

Now restart Apache2:

/etc/init.d/apache2 restart

Now reload http://192.168.0.100/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the MySQL module:

phpMyAdmin

phpMyAdmin is a web interface through which you can manage your MySQL databases. It’s a good idea to install it:

aptitude install phpmyadmin

You will see the following questions:

Web server to reconfigure automatically: <– apache2
Configure database for phpmyadmin with dbconfig-common? <– No

Afterwards, you can access phpMyAdmin under http://192.168.0.100/phpmyadmin/:

http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-ubuntu-10.04-lamp-p2

Leave a Comment more...





Installing freeNX Server

by on Jun.22, 2010, under CentOs

Install freenx using yum:
# yum install nx freenx

Copy minimal configuration file:
# cp /etc/nxserver/node.conf.sample /etc/nxserver/node.conf

Enable PASSDB for NX Database User Authentication pass-through:
vi /etc/nxserver/node.conf

Uncomment and change the following line in /etc/nxserver/node.conf
ENABLE_PASSDB_AUTHENTICATION="1"

Add a user account to the nxserver database ( the user account must already exist on the system as a standard linux user account, I’ll use root for e.g):
# nxserver --adduser root

Give the user a password:
# nxserver --passwd root

freeNX SSH Keys configuration:
In order for freeNX to function securely we need to copy the ssh key from the remote server system to the local machines NoMachine client software.

On the remote server system copy the client.id_dsa.key contents (including the —BEGIN— and —- END— lines):
# cat /var/lib/nxserver/home/.ssh/client.id_dsa.key

On the local client system open the NX client software and enter the SSH Key.

Leave a Comment more...





Installing Apache2 And PHP5 On CentOs 5

by on Jun.22, 2010, under CentOs

To install Apache2 And PHP5 On CentOs 5 type the following.

yum install httpd php php-devel

Then create the system startup links for Apache2 and start Apache2:

chkconfig --levels 235 httpd on

/etc/init.d/httpd start 

 

 

You now have a PHP5 with basic functionality on your server; if you need special PHP5 modules, you can search for them like this:

yum search php

From the output, pick the modules you need, install them like this and restart Apache2:

yum install php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc 

 

/etc/init.d/httpd restart

Getting Details About Your PHP5 Installation

vi /var/www/html/info.php

Hit i to enter text on the SSH screen and add the following. Hitting Esc will exit the text input mode. Then hit alt+; and type x after the ;. (e.g “:x” without the “”) This exits and saves it.

<?php phpinfo(); ?>

Now we call that file in a browser to test it.(e.g. http://127.0.0.1/info.php):


15 Comments more...





Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!