How to list all users on a Linux machine?
August 16th, 2008 cat /etc/passwd | cut -d":" -f1
cat /etc/passwd | cut -d":" -f1
Follow the links:
Virtual host examples from Apache website.
http://httpd.apache.org/docs/2.0/vhosts/examples.html
Turns out that it is possible to have multiple VirtualHosts on port 80 (Default http), but because of a limitation of SSL, we can’t have multiple VirtualHosts on port 443 (Default https).
I solved the problem as follows. I created the two VirtualHosts on port 80, one on port 443 and one on port 444.
Shared IP, multiple vhosts and multiple SSL certificates on Apache
The process is only 2 steps and involves modifying your Apache configuration.
1. Create virtual hosts “map file”.
2. Modify existing SSL vhost.Caveat: The SSL certificate used will be common to all SSL vhosts.
Hosting multiple SSL vhosts on a single IP/Port/Certificate with Apache2
The following article discusses the following:
Basics Of Virtual Hosts, Name-Based Virtual Hosts, IP-Based Virtual Hosts, Configuring IP Aliasing, Virtual Hosts with IPs, Multiple Instances of Apache, Example for name based virtual hosts, Example for IP based virtual hosts.
$ gzip -d compressed_file.gz
<html>body {
<head>
<style type="text/css">
font-size: 12px;
font-family: arial;
}
a {
margin-top: 1px;
display:block;
line-height: 25px;
border-left: solid 10px #DDDDDD;
text-decoration: none;
padding-left: 11px;
background-color: #EEEEEE;
}
a:link {}
a:visited {}
a:hover {
padding-left: 12px;
border-left: solid 10px green;
border-bottom: 1px #333333;
background-color: #CCCCCC;
color: blue;
}
a:active {}
</style>
</head>
<body>
<div style="margin: 50px 0 0 10px; width: 220px;">
<div><a href="../saps.php">visitors, click here</a></div>
<div><a href="cms/">admin, proceed to saps</a></div>
</div>
</body>
</html>
These free tools have been designed to validate and check the health of your public DNS servers.
Free Secondary DNS for your domains. If your looking for another DNS to put your domain in, this is for you. Providing additional secondary servers can greatly improve the reliability and accessibility of your domain. Should your primary DNS become unavailable due to network problems, your secondary DNS entries come into play, the more DNS servers you have, the greater the resilience to errors.
Here are the SQL commands:
create database newdb;
grant CREATE,INSERT,DELETE,UPDATE,SELECT on newdb.* to newuser@localhost;
SET PASSWORD FOR 'newuser'@'localhost' = password(’newuserpass’);
– or –
SET PASSWORD FOR 'newuser'@'localhost' = old_password(’newuserpass’);
flush privileges;
Here are the steps:
Edit the pri.yourname.com file for the domain you are adding nameservers for.
Add these two lines at the bottom of the file:
ns1 IN A 10.10.10.10 (replace with your nameserver IP)
ns2 IN A 10.10.10.10
By the way, you can host your website and nameservers on the same IP.
$ sudo /etc/init.d/bind9 reloadnameserver 127.0.0.1To keep the root hints file current, use the following command.
$ dig @a.root-servers.net . ns > db.cache
If you are running BIND 9, you have handy new tools to help maintain your nameserver files: named-checkconf and named-checkzone. These tools reside in /usr/sbin or /usr/local/sbin.
named-checkconf checks the configuration file for syntax errors.
$ /usr/sbin/named-checkconf zonename db.local
zone zonename/IN: loaded serial 1
OK
named-checkzone checks a zone file for syntax errors.
$ /usr/sbin/named-checkzone zonename pri.108.10.20.in-addr.arpa
zone zonename/IN: loaded serial 2004071902
OK
This how-to assumes a Debian-type Linux server.
1) Install BIND
$ sudo apt-get install bind9
2) Run BIND chrooted. For security reasons we want to run BIND chrooted so we have to do the following:
$ sudo /etc/init.d/bind9 stop
Edit the file /etc/default/bind9 so that the daemon will run as the unprivileged user bind, chrooted to /var/lib/named. Modify the line: OPTIONS=”-u bind” so that it reads OPTIONS=”-u bind -t /var/lib/named”:
$ sudo vi /etc/default/bind9OPTIONS="-u bind -t /var/lib/named" # Set RESOLVCONF=no to not run resolvconfRESOLVCONF=yes
3) Create the necessary directories under /var/lib:
$ sudomkdir -p /var/lib/named/etc
$ sudomkdir /var/lib/named/dev
$ sudomkdir -p /var/lib/named/var/cache/bind
$ sudomkdir -p /var/lib/named/var/run/bind/run
4) Then move the config directory from /etc to /var/lib/named/etc:
$ sudomv /etc/bind /var/lib/named/etc
5) Create a symlink to the new config directory from the old location (to avoid problems when bind gets updated in the future):
$ sudoln -s /var/lib/named/etc/bind /etc/bind
6) Make null and random devices, and fix permissions of the directories:
$ sudomknod /var/lib/named/dev/null c 1 3
$ sudomknod /var/lib/named/dev/random c 1 8
$ sudochmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
$ sudochown -R bind:bind /var/lib/named/var/*
$ sudochown -R bind:bind /var/lib/named/etc/bind
7) We need to modify /etc/default/syslogd so that we can still get important messages logged to the system logs. Modify the line: SYSLOGD=”" so that it reads: SYSLOGD=”-a /var/lib/named/dev/log”:
$ sudovi /etc/default/syslogd## Top configuration file for syslogd ## # Full documentation of possible arguments are found in the manpage # syslogd(8). # # # For remote UDP logging use SYSLOGD="-r" # SYSLOGD="-a /var/lib/named/dev/log"
9) Restart the logging daemon:
$ sudo/etc/init.d/sysklogd restart
10) Start up BIND, and check /var/log/syslog for errors:
$ sudo/etc/init.d/bind9 start