How to install LAMP (Apache MySQL and PHP) on CentOS

This is first article from next few I will write about LAMP.

I will not write about what LAMP is, I guess that you already know since you are reading how to install it.

So, to install LAMP in Linux CentOS, follow next steps:

First, make sure that your system is up to date:

# yum update -y

Once update is finished, you need to install Apache:

# yum install httpd -y

After installation, you need to add apache service to system startup:

# chkconfig --levels 235 httpd on

and then start it up:

# service httpd start

Now, open your browser and go to localhost, or http://yourdomain.tld and you should see Apache default page.

Next step is to install PHP as an Apache module (mod_php). Do it like this:

# yum install php -y

After you install it, you have to check is everything’s fine. You need to create an PHP info page, and put it in Apache root ( /var/www/html ), so you can check that PHP support is enabled:

# echo -e "<?php\n\tphpinfo();\n?>" > /var/www/html/info.php

Once you created info.php file, you need to reload Apache, so installed PHP module can take effect:

# service httpd restart

Now you need to open this file with your browser. Go to http://yourdomain.tld/info.php and you should see a page with some PHP info.

Now you need to install MySQL support. This mean that you have to install PHP module for MySQL. Beside this, it’s good to install and module for PHP console and PHP common files:

# yum install php-cli php-common php-gd php-mysql -y

Again, restart Apache:

# service httpd restart

After all this, now you need to install the last main component of LAMP stack – MySQL server. Do it like this:

# yum install mysql mysql-server -y

and then add to system startup, and run the service:

# chkconfig --levels 235 mysqld on
# service mysqld start

Once it is started, it’s good that you set MySQL root password. Also, it’s recommended to disable remote root login if you don’t really need it. It’s good that you remove anonymous users and remote ‘test’ database right away as well. All this you can do with:

# mysql_secure_installation

After this, your installation of LAMP is finished. Of course, there is more stuff you should install, but this is the basic.

In next article, to this installation, we will add PhpMyAdmin, some cashe engine, and some more cool stuff.

 


If you liked the post, we should get connected - follow me on Twitter

Tunneling applications with TSocks for anonymity using TOR

Have you ever thought how great it would be if you could run your hacking tools for information gathering/scanning/exploiting anonymously from terminal?

Here is one of the ways to do this, even your tools are without options for proxy.

 

You will need TSocks, and Tor installed. Nothing more.
In my BackTrack machine, TSocks is already installed. If you don’t have it, install it first.
After you do this, open /etc/tsocks.conf and edit server_port line, to port 9050 (default Tor port):

server_port = 9050

Then, you need to install Tor. Here you have simply explained how to install Tor. Install just Tor, you don’t need Privoxy.
After configuring tsocks, try to check if it’s working good by using the lynx web browser to connect to a website which will show you your current IP address. So when you want to run your tool anonymously, just add tsocks at the beginning. For example, to run lynx:

tsocks lynx whatismyip.net

If everything works fine, you will get some address from Tor network, and not your private:

 

Just to make sure, run the same application without tsocks:

lynx whatismyip.net

Here is how it looks now, with my real IP address:
lynx - jovica ilic

 

So now, when you are sure that tsocks tunelling works fine, you can run all your nasty tools anonymously. Also, you can start f.e. Firefox and surf anonymously this way, just with typing:

tsocks firefox

That’s it! It’s just one of the ways. Have fun ;)

 


If you liked the post, we should get connected - follow me on Twitter

Oracle PeopleSoft – PeopleTools License Code Problems

If you are installing Oracle PeopleTools or any other Oracle PeopleSoft module on Linux/Unix machine, in console, then it’s possible that you will get into problem with entering valid license code.
When you get to part of installation where it asks you for license code, go to Oracle products license codes.

Find code for software you are installing and enter it. You will get an error that license code is not valid, if you just copy/paste code, or you enter it how it’s shown on Oracle page.

The thing is, you need to remove the “-” from code you are entering. After this, license code will be accepted, and installation will continue. This applies only for Linux/Unix systems.

 

Picture source.


If you liked the post, we should get connected - follow me on Twitter

How To Install and Configure freeNX

If you need to setup GUI access on a remote server system(Linux) and connect to it, you can try freeNX.
This is example how to install and configure freeNX in CentOS 5.

Server installation

On the server you want to control with freeNX you need to do next:

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:

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):

# nxserver --adduser <username>

Give the user a password:

# nxserver --passwd <username>

Optional: If your SSH server is not at default port (22), you have to configure this also. So, open node.conf, find line #SSHD_PORT=22, uncomment it, set your port, and save changes.

 

 

Client installation

The NoMachine client needs to be downloaded from their site. Download the client that matches the operating system on your local machine.

http://www.nomachine.com/download.php

After installing the NoMachine client open the NX Connection Wizard.

Enter a Session Name, Hostname or IP of the remote server system, SSH Port number of the remote server system (usually 22), and select your connection type, desktop system and the size of the desktop. In this case, for connection to CentOS, in desktop settings, select Unix, Gnome.

 

freenx - Jovica Ilic blog

 

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 click on “Configure”:

Under the General tab, click “Key”

Delete the contents and paste in the contents from the remote server system/var/lib/nxserver/home/.ssh/client.id_dsa.key

Now connect using the username and password you created when you configured freeNX on the remote server system.

 

Common Error:

The nx service is not available or the nx access was disabled

The issue with the above error is that you copied the wrong ssh key and most likely followed the process from an old tutorial that told you to copy the key from /etc/nxserver or told you to create your own key. The key you should copy is found at /var/lib/nxserver/home/.ssh/client.id_dsa.key


If you liked the post, we should get connected - follow me on Twitter

SSH Replacement – Mosh

Mosh(mobile shell) is something new I found out last days.

Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.

Basically, Mosh is a replacement for SSH. It’s more robust and responsive, especially over Wi-Fi or long-distance links.

So, we are all aware of problem that most of network programs lose their connections after roaming.  Mosh solves this problem. It automatically roams as you move between Internet connections. Whether you use Wi-Fi on one spot, Ethernet in a other, and LTE on third place, you’ll stay logged in. That’s it.

With Mosh, you can put your laptop to sleep mode, and when you wake it up later, your conection will be intact. Pretty cool isn’t it?

 

 

For more information, visit Mosh homepage.


If you liked the post, we should get connected - follow me on Twitter