Skip to main content

LAMP Configuration at userdefined location.

#############################
##### LAMP CONFIGURATION ####
#Created By : JINO JOSEPH ###
#Created Date : 23-10-2010 ##
#############################

### CONFIGURING APACHE ###

1. Go to the directory where the downloaded packages reside. In my case it is at/usr/src
# cd /usr/src
Now uncompress and extract the file httpd-2.0.44.tar.gz
# tar -zxvf httpd-2.0.44.tar.gz
This will create a folder httpd-2.0.44
# cd httpd-2.0.44
# ./configure --prefix=/lamp --enable-so
# make
# make install
# /lamp/bin/apachectl start

### CONFIGURING MYSQL ###

# groupadd mysql
# useradd -R mysql mysql
# cd /usr/src
# tar -zxvf mysql-5.1.tar.gz
# cd mysql-5.1
# ./configure --prefix=/lamp/mysql
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
Here an option file is created. If you want to configure support for InnoDB tables you should edit the /etc/my.conf files remove the '#' character before the option lines that start with innodb_ and modify the option value to what u want.

# cd /lamp
# chown -R mysql mysql
# chgrp -R mysql mysql
This will change the owner and group of the directory mysql as mysql

# bin/mysql_install_db --user=mysql
This will create the mysql data directory /var in the /lamp directory.

# chown -R root mysql

# /lamp/bin/mysqll_safe --user=mysql &
This will start the mysql daemon.

# cd /usr/src/mysql-5.1
# cp support-files/mysql.server /etc/rc.d/init.d/mysql
# chmod +x /etc/rc.d/init.d/mysql
# chkconfig mysql on
These command will help you to start the mysql automatically when u boot up the system.
# /etc/rc.d/init.d/mysql start

Note:
Inorder to run the mysql commands from anyplace without having to specify the long path /lamp/mysql/bin.....

# ln -s /lamp/mysql/bin/$* /usr/bin/$*
This will create a symbolic link of all files residing in the /lamb/mysql/bin pointing to /usr/bin/

now you can run the mysqladmin command from the root dir itself.

# mysqladmin -u root password
# mysql -u root -p
Enter the previously given password.
U r in the mysql shell
mysql> show database;

quit;

That is it.. :-)

### CONFIGURING PHP ###

# cd /usr/src/
# tar -zxvf php-4.3.0.tar.gz
# cd php-4.3.0

# ./configure --prefix=/lamp/php --with-apxs2=/lamp/bin/apxs --with-config-file-path=/lamp/php --with-mysql
The second option --with-apxs2 point to the apxs file in the apache.

# make
# /lamp/bin/apachectl stop
# make install
This will install php module to Apache's modules sub-directory /lamp/modules and add a line like this "LoadModule php5_module /lamp/modules/libphp5.so" to the /lamp/conf/httpd.conf. This line allows apache to automatically load PHP modules when Apache starts.

Now add the line "AddType application/x-httpd-php .php" to /lamp/conf/httpd.conf so that Apache invokes php parser whenever a file with extension (.php) is accessed.

Now create a file with extension phpinfo.php in the directory /lamp/htdocs

and enter the below code:


phpinfo();

?>

# /lamp/bin/apachectl start

Now open the browser and check the url http://localhost/phpinfo.php

There you can see all the information about apache, php and mysql and lot more.

:-)

Comments

Popular posts from this blog

Password reset too simplistic/systematic issue

Some time when we try to reset the password of our user in linux it will show as simple and systematic as below: BAD PASSWORD: it is too simplistic/systematic no matter how hard password you give it will show the same. Solution: ######### Check if your password is Ok with the below command, jino@ndz~$ echo 'D7y8HK#56r89lj&8*&^%&^%#56rlKJ!789l' | cracklib-check D7y8HK#56r89lj&8*&^%&^%#56rlKJ!789l: it is too simplistic/systematic Now Create a password with the below command : jino@ndz~$ echo $(tr -dc '[:graph:]' 7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K; You can see that this password will be ok with the cracklib-check. jino@ndz~$ echo '7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K;' | cracklib-check                 7\xi%!W[y*S}g-H7W~gbEB4cv,9:E:K;: OK Thats all, Thanks.

Setting /etc/hosts entries during the initial deployment of an Application using k8s yaml file

Some times we have to enter specific hosts file entries to the container running inside the POD of a kubernetes deployment during the initial deployment stage itself. If these entries are not in place, the application env variables mentioned in the yaml file , as hostnames , will not resolve to the IP address and the application will not start properly. So to make sure the /etc/hosts file entries are already there after the spin up of the POD you can add the below entries in your yaml file. cat > api-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: spec:   template:     metadata:     spec:       volumes:       containers:       - image: registryserver.jinojoseph.com:5000/jinojosephimage:v1.13         lifecycle:           postStart:             exec:               command:...

Running K8s cluster service kubelet with Swap Memory Enabled

For enabling swap memory check the below link : https://jinojoseph.blogspot.com/2019/10/enable-swap-memory-using-swapfile-in.html # sudo vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf Add the KUBELET_EXTRA_ARGS line as below: ---------------------------------------- Environment="KUBELET_EXTRA_ARGS=--fail-swap-on=false" ExecStart= ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS Now kubelet.service changed on disk. Run 'systemctl daemon-reload' to reload units # sudo systemctl daemon-reload # sudo systemctl restart kubelet # sudo systemctl status kubelet That is all cheers :p