How To Create a User Account For Apache.

If you want to run your site on browser,then you need to create an apache-account. So if you follow the following steps then you can easily run your site on browser.

For creating a user account for apache, run following commads

#cd /home

For adding a user, run this command on your terminal


Now add a password for user and run command


After creating a user account, we create some directory in user account

First we change our dirctory


Now you create here a directory name : public_html and the command is

#mkdir public_html

Now you again change directory

#cd public_html

here you create one more directory, name is cgi-bin and the command is

#mkdir cgi-bin

Here you also create an html page which is your test page.

#vi index.html

This command will open a blank page, write some comments there and save this page
and comeback to the home directory.

Now you change the permissions and also change owner and group of all directories and file.

#chmod -R 755
#chown -R ownername:groupname

After completing these steps, we run our url in browser and it displays our test page.

Now we paste our code for specific site in public_html and change it’s permissions,owner and group.

Now we create database for user account.
First we login in mysql using this command

#mysql -u -p

After that we run command for show database table which already exist.

mysql:>show databases;

Now run this command for creating database.

mysql:>create database ;

After that we again run “show databases” command for checking our new table.

Now run this command for setting user and password for that database table.

mysql:>grant usage on .* to databse username@localhost
dentified by 'password';

After that, run this command for setting permissions on database.

mysql:>grant all privileges on .* to database username@localhost;

Now run this command for flushing all privileges.

mysql:>flush privileges;

And run “quit” command for exit.
Now you have to run your Url in browser.

Comments on this entry are closed.