Wednesday, May 21, 2014

Linux Problem Solution

How To Block Pings ICMP


first, ping your server and make sure you are getting ping replies. i am using widows xp, so i will open the DOS terminal and ping my ip: example:

C:\Users\MyPC>ping 192.168.0.2

Pinging 192.168.0.2 with 32 bytes of data:
Reply from 192.168.0.2: bytes=32 time<1ms TTL=12
Reply from 192.168.0.2: bytes=32 time<1ms TTL=12
Reply from 192.168.0.2: bytes=32 time<1ms TTL=12
Reply from 192.168.0.2: bytes=32 time<1ms TTL=12

Ping statistics for 192.168.0.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
then send this command to edit sysctl.conf
SHELL COMMAND:
# Vim  /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_all = 1
#/etc/init.d/network  restart


web server problem with virtualhost


First time LAMP and domain setup on CentOs. Previous experience of this is in Ubuntu. Working on a dedicated server package of my local ISP. They installed default CentOs 6.2 and redirected my domain to the server. Pinging mydomain.com works fine to reach the server's IP.
I have successfully installed LAMP on the box using this howto explanation. All seems fine.
I have edited /etc/hosts:
127.0.0.1      mydomain.com
I have also edited the /etc/httpd/conf/httpd.conf and added the following at the end of the file, while keeping the rest default:
NameVirtualHost *:80

<VirtualHost *:80>
   DocumentRoot /var/www/html
   ServerName localhost
   <Directory /var/www/html>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>
</VirtualHost> <VirtualHost *:80> ServerName mydomain.com ServerAlias www.mydomain.com ServerAdmin myemailaddress@email.com DocumentRoot /var/www/html/mydomain.com <Directory "/var/www/html/mydomain.com"> Options Includes FollowSymLinks AllowOverride All allow from all </Directory> ErrorLog /var/www/logs/mydopmain.com.default.log </VirtualHost>
And i also ran
chmod -R apache:apache /var/www/html


How to Automatically Add the "www" Prefix to Your Domain Names in URLs

To redirect (say) example.com to www.example.com, add the following code to your .htaccess file.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
The above code causes the server to check that the domain name portion of the URL is example.com. If it is, the visitor will be sent to www.example.com instead. If you also own, say example.co.uk, example.de and/or some other domain, and want them to be redirected to www.example.com as well, you may prefer to use the following code instead:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

How to Remove the WWW Prefix from Your Domain Names Using

To redirect any URL starting with (say) www.example.com to example.com
add the following codeto your .htaccess file.


RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
The above rules checks if the domain name component in a URL contains www.example.com. If it does, the visitor is sent to example.com instead. To use the rule, change all instances of "example.com" to your actual domain name. For the line beginning with RewriteCond, add a backslash ("\") before each of the full stops (or "periods") in your domain name.

CentOS 5.2 yum repository error

 Iinitially there were two repo files in the /etc/yum.repos.d directory

# CentOS-Base.repo

#

# This file uses a new mirrorlist system developed by Lance Davis for CentOS.

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client.  You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the 

# remarked out baseurl= line instead.

#

#



[base]

name=CentOS-$releasever - Base

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5



#released updates 

[updates]

name=CentOS-$releasever - Updates

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5



#packages used/produced in the build but not released

[addons]

name=CentOS-$releasever - Addons

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons

#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5



#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5



#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


Apt-get GPG Error: Public Key Not Available in Ubuntu

Sometimes while updating your Ubuntu using terminal you get some error showing missing public key & thus failing to update.You can get the key using the command given below.Just replace the key with the key in error.
wget -q “http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x(4874D3686E80C6B7)” -O- | sudo apt-key add -
or
visit http://keyserver.ubuntu.com:11371/ to get the public key manually

How To Protect Web Page Directories With Passwords

You can password protect content in both the main and subdirectories of your DocumentRoot fairly easily. I know people who allow normal access to their regular Web pages, but require passwords for directories or pages that show MRTG or Webalizer data. This example shows how to password protect the /home/www directory.

1) Use Apache's htpasswd password utility to create username/password combinations independent of your system login password for Web page access. You have to specify the location of the password file, and if it doesn't yet exist, you have to include a -c, or create, switch on the command line. I recommend placing the file in your /etc/httpd/conf directory, away from the DocumentRoot tree where Web users could possibly view it. Here is an example for a first user named peter and a second named paul:
[root@bigboy tmp]# htpasswd -c /etc/httpd/conf/.htpasswd peter
New password:
Re-type new password:
Adding password for user peter
[root@bigboy tmp]#

[root@bigboy tmp]# htpasswd /etc/httpd/conf/.htpasswd paul
New password:
Re-type new password:
Adding password for user paul
[root@bigboy tmp]#
2) Make the .htpasswd file readable by all users.
[root@bigboy tmp]# chmod 644 /etc/httpd/conf/.htpasswd
3) Create a .htaccess file in the directory to which you want password control with these entries.
AuthUserFile /etc/httpd/conf/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic
require user peter
Remember this password protects the directory and all its subdirectories. The AuthUserFile tells Apache to use the .htpasswd file. The require user statement tells Apache that only user peter in the .htpasswd file should have access. If you want all .htpasswd users to have access, replace this line with require valid-user. AuthType Basic instructs Apache to accept basic unencrypted passwords from the remote users' Web browser.
4) Set the correct file protections on your new .htaccess file in the directory /home/www.
[root@bigboy tmp]# chmod 644 /home/www/.htaccess
5) Make sure your /etc/httpd/conf/http.conf file has an AllowOverride statement in a <Directory> directive for any directory in the tree above /home/www. In this example below, all directories below /var/www/ require password authorization.
<Directory /home/www/*>
   AllowOverride AuthConfig
</Directory>
6) Make sure that you have a <VirtualHost> directive that defines access to /home/www or another directory higher up in the tree.
<VirtualHost *>
   ServerName 97.158.253.26
   DocumentRoot /home/www
</VirtualHost>
7) Restart Apache.
Try accessing the web site and you'll be prompted for a password.

WEB Server

Install

[root@www ~]# yum -y install httpd
# remove welcome page
[root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf
# remove default error page
[root@www ~]# rm -f /var/www/error/noindex.html
# create a link for Perl
[root@www ~]# ln -s /usr/bin/perl /usr/local/bin/perl

Configure httpd.


[root@www ~]# vi /etc/httpd/conf/httpd.conf
# line 44: change
ServerTokens Prod
# line 76: change to ON
KeepAlive On
# line 262: Admin's address
ServerAdmin root@server.world
# line 276: change to your server's name
ServerName www.server.world:80
# line 331: change (enable CGI and disable Indexes)
Options FollowSymLinks ExecCGI
# line 338: change
AllowOverride All
# line 402: add file name that it can access only with directory's name
DirectoryIndex index.html index.cgi index.php
# line 536: change
ServerSignature Off
# line 759: make it comment
#AddDefaultCharset UTF-8
# line 796: uncomment and add file-type that apache looks them CGI
AddHandler cgi-script .cgi .pl
[root@www ~]# /etc/rc.d/init.d/httpd start
Starting httpd: [ OK ]
[root@www ~]# chkconfig httpd on
------------------------------------------------------------------------------------------------------------

Configration of SSL
[root@www ~]# yum -y install mod_ssl
[root@www ~]# vi /etc/httpd/conf.d/ssl.conf
# line 77: uncomment
DocumentRoot "/var/www/html"
# line 78: uncomment and specify server name
ServerName www.server.world:443
# line 105: specify certificate
SSLCertificateFile /etc/pki/tls/certs/server.crt
# line 112: specify certification key
SSLCertificateKeyFile /etc/pki/tls/certs/server.key
[root@www ~]# /etc/rc.d/init.d/httpd restart 
Stopping httpd: [ OK ]
Starting httpd: [ OK
------------------------------------------------------------------------------------------------------------
Virtual Hostings

[root@www ~]# vi /etc/httpd/conf/httpd.conf
# line 990: uncomment
NameVirtualHost *:80
# at the last lines: ( for original domain )
<VirtualHost *:80>
   DocumentRoot /var/www/html
   ServerName www.server.world
</VirtualHost>
# at the last lines: ( for virtual domain )
<VirtualHost *:80>
   DocumentRoot /home/cent/public_html
   ServerName www.virtual.host
   ServerAdmin webmaster@virtual.host
   ErrorLog logs/virtual.host-error_log
   CustomLog logs/virtual.host-access_log combined
</VirtualHost>
[root@www ~]# /etc/rc.d/init.d/httpd restart 
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]
------------------------------------------------------------------------------------------------------------


Log Visitors

[root@www ~]# yum -y install graphviz
[root@www ~]# wget http://www.hping.org/visitors/visitors-0.7.tar.gz
[root@www ~]# tar zxvf visitors-0.7.tar.gz
[root@www ~]# cd visitors_0.7
[root@www visitors_0.7]# make
[root@www visitors_0.7]# cp visitors /usr/local/bin/
[root@www visitors_0.7]# cd
[root@www ~]# mkdir /var/www/html/visitors
[root@www ~]# vi /etc/httpd/conf.d/visitors.conf
# create new
<Location /visitors>
   Order Deny,Allow
   Deny from all
   Allow from 10.0.0.0/24# IP address you allow
</Location>
[root@www ~]# /etc/rc.d/init.d/httpd restart
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]
# generate common reports
[root@www ~]# visitors -A /var/log/httpd/access_log -o html > /var/www/html/visitors/index.html
--
11 lines processed in 1 seconds
0 invalid lines, 0 blacklisted referers
# generate page tour reports
[root@www ~]# visitors -A -m 30 /var/log/httpd/access_log -o html --trails --prefix http://www.server.world > /var/www/html/visitors/trails.html
--
11 lines processed in 1 seconds
0 invalid lines, 0 blacklisted referers
# generate page tour image
[root@www ~]# visitors /var/log/httpd/access_log --prefix http://www.server.world -V > /var/www/html/visitors/graph.dot
--
11 lines processed in 1 seconds
0 invalid lines, 0 blacklisted referers
[root@www ~]# dot -Tpng /var/www/html/visitors/graph.dot > /var/www/html/visitors/graph.png

MySQL Commands

To login (from unix shell) use -h only if needed.
# [mysql dir]/bin/mysql -h hostname -u root -p
Create a database on the sql server.
mysql> create database [databasename];
List all databases on the sql server.
mysql> show databases;
Switch to a database.
mysql> use [db name];
To see all the tables in the db.
mysql> show tables;
To see database's field formats.
mysql> describe [table name];
To delete a db.
mysql> drop database [database name];
To delete a table.
mysql> drop table [table name];
Show all data in a table.
mysql> SELECT * FROM [table name];
Returns the columns and column information pertaining to the designated table.
mysql> show columns from [table name];
Show certain selected rows with the value "whatever".
mysql> SELECT * FROM [table name] WHERE [field name] = "whatever";
Show all records containing the name "Bob" AND the phone number '3444444'.
mysql> SELECT * FROM [table name] WHERE name = "Bob" AND phone_number = '3444444';
Show all records not containing the name "Bob" AND the phone number '3444444' order by the phone_number field.
mysql> SELECT * FROM [table name] WHERE name != "Bob" AND phone_number = '3444444' order by phone_number;
Show all records starting with the letters 'bob' AND the phone number '3444444'.
mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444';
Show all records starting with the letters 'bob' AND the phone number '3444444' limit to records 1 through 5.
mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444' limit 1,5;
Use a regular expression to find records. Use "REGEXP BINARY" to force case-sensitivity. This finds any record beginning with a.
mysql> SELECT * FROM [table name] WHERE rec RLIKE "^a";
Show unique records.
mysql> SELECT DISTINCT [column name] FROM [table name];
Show selected records sorted in an ascending (asc) or descending (desc).
mysql> SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;
Return number of rows.
mysql> SELECT COUNT(*) FROM [table name];
Sum column.
mysql> SELECT SUM(*) FROM [table name];
Join tables on common columns.
mysql> select lookup.illustrationid, lookup.personid,person.birthday from lookup left join person on lookup.personid=person.personid=statement to join birthday in person table with primary illustration id;
Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.
# mysql -u root -p
mysql> use mysql;
mysql> INSERT INTO user (Host,User,Password) VALUES('%','username',PASSWORD('password'));
mysql> flush privileges;
Change a users password from unix shell.
# [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p password 'new-password'
Change a users password from MySQL prompt. Login as root. Set the password. Update privs.
# mysql -u root -p
mysql> SET PASSWORD FOR 'user'@'hostname' = PASSWORD('passwordhere');
mysql> flush privileges;
Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.
# /etc/init.d/mysql stop
# mysqld_safe --skip-grant-tables &
# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where User='root';
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysql stop
# /etc/init.d/mysql start
Set a root password if there is on root password.
# mysqladmin -u root password newpassword
Update a root password.
# mysqladmin -u root -p oldpassword newpassword
Allow the user "bob" to connect to the server from localhost using the password "passwd". Login as root. Switch to the MySQL db. Give privs. Update privs.
# mysql -u root -p
mysql> use mysql;
mysql> grant usage on *.* to bob@localhost identified by 'passwd';
mysql> flush privileges;
Give user privilages for a db. Login as root. Switch to the MySQL db. Grant privs. Update privs.
# mysql -u root -p
mysql> use mysql;
mysql> INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES ('%','databasename','username','Y','Y','Y','Y','Y','N');
mysql> flush privileges;

or

mysql> grant all privileges on databasename.* to username@localhost;
mysql> flush privileges;
To update info already in a table.
mysql> UPDATE [table name] SET Select_priv = 'Y',Insert_priv = 'Y',Update_priv = 'Y' where [field name] = 'user';
Delete a row(s) from a table.
mysql> DELETE from [table name] where [field name] = 'whatever';
Update database permissions/privilages.
mysql> flush privileges;
Delete a column.
mysql> alter table [table name] drop column [column name];
Add a new column to db.
mysql> alter table [table name] add column [new column name] varchar (20);
Change column name.
mysql> alter table [table name] change [old column name] [new column name] varchar (50);
Make a unique column so you get no dupes.
mysql> alter table [table name] add unique ([column name]);
Make a column bigger.
mysql> alter table [table name] modify [column name] VARCHAR(3);
Delete unique from table.
mysql> alter table [table name] drop index [colmn name];
Load a CSV file into a table.
mysql> LOAD DATA INFILE '/tmp/filename.csv' replace INTO TABLE [table name] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1,field2,field3);
Dump all databases for backup. Backup file is sql commands to recreate all db's.
# [mysql dir]/bin/mysqldump -u root -ppassword --opt >/tmp/alldatabases.sql
Dump one database for backup.
# [mysql dir]/bin/mysqldump -u username -ppassword --databases databasename >/tmp/databasename.sql
Dump a table from a database.
# [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename > /tmp/databasename.tablename.sql
Restore database (or database table) from backup.
# [mysql dir]/bin/mysql -u username -ppassword databasename < /tmp/databasename.sql
Create Table Example 1.
mysql> CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255));
Create Table Example 2.
mysql> create table [table name] (personid int(50) not null auto_increment primary key,firstname varchar(35),middlename varchar(50),lastnamevarchar(50) default 'bato');

Installing cPanel & WHM on CentOS (4.x, 5.x, 6.x)

To install cPanel & WHM, follow these 6 steps: 
Demos of cPanel and WebHost Manager are available Click here
source : docs.cpanel.net

ESXi-Customizer

ESXi-Customizer is a Windows script that automates the process of re-building the VMware ESXi Install ISOs with custom drivers.


Download : ESXi-Customizer-v2.7.1

Ubuntu dns server configuration

Ubuntu dns server configuration involves many files. I would like to remind you again, please make a backup for every files before you begin editing. Example below:



luzar@ubuntu:/etc/bind$ sudo cp named.conf.local named.conf.local.bak
luzar@ubuntu:/etc/bind$ sudo cp named.conf.options named.conf.options.bak



The first file we are going to edit is the named.conf.local file. Use your favorite editor to open named.conf.local file.



luzar@ubuntu:/etc/bind$ sudo vim /etc/bind/named.conf.local



Type the code below. Replace example.com. with your domain name.



zone "example.com" in {
allow-transfer { any; };
file "/etc/bind/db.example.com.";
type master;
};


// Set up reversed name resolution
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.192";
};



Example of /etc/bind/db.example.com configuration.



;
; BIND data file for local loopback interface
;
$TTL  604800
@   IN  SOA  ubuntu.example.com.  root.example.com. (
           2008112202           ; Serial
               604800           ; Refresh
                86400           ; Retry
              2419200           ; Expire
                86400 )         ; Negative Cache TTL
;

example.com   IN MX   mail.example.com.
@       IN NS           ubuntu.example.com.
@       IN A            192.168.1.3
ubuntu  IN A            192.168.1.3
web     IN CNAME        ubuntu.example.com.



Example of /etc/bind/db.192 configuration.

;
; Reverse lookup DNS Zone file
;
$TTL    604800
@   IN   SOA   ubuntu.example.com.  root.example.com. (
             2008112302         ; Serial
                 604800         ; Refresh
                  86400         ; Retry
                2419200         ; Expire
                  86400 )       ; Negative Cache TTL
@       IN NS           ubuntu.
3       IN CNAME        ubuntu.example.com.



You have to set the ISP dns server ip address. Put it in /etc/bind/named.conf.options forwarders:



        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.


        forwarders {
        123.123.0.123;
        123.123.1.1;
        };



Example of /etc/resolv.conf configuration:
search example.comnameserver 192.168.1.3
Example of /etc/hosts configuration:

127.0.0.1 localhost
192.168.1.3     ubuntu.example.com      ubuntu

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopbackfe00
::0 ip6-localnetff00
::0 ip6-mcastprefixff02
::1 ip6-allnodesff02
::2 ip6-allroutersff02
::3 ip6-allhosts

Restart bind9 service with the command below:

luzar@ubuntu:~$ sudo /etc/init.d/bind9 restart
 * Stopping domain name service... bind      [ OK ]
 * Starting domain name service... bind      [ OK ]

luzar@ubuntu:~$ tail /var/log/messages

Testing dns with dig domain name command:
luzar@ubuntu:/etc/bind$ dig example.com

; <<>> DiG 9.4.2-P2 <<>> example.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34700
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1,
ADDITIONAL: 1

;; QUESTION SECTION:;example.com.             IN      A


;; ANSWER SECTION:
example.com.        604800  IN  A    192.168.1.3


;; AUTHORITY SECTION:
example.com.        604800  IN  NS   ubuntu.example.com.


;; ADDITIONAL SECTION:
ubuntu.example.com. 604800  IN  A    192.168.1.3


;; Query time: 0 msec
;; SERVER: 192.168.1.3#53(192.168.1.3)
;; WHEN: Sun Nov 23 04:23:18 2008
;; MSG SIZE  rcvd: 82

luzar@ubuntu:/etc/bind$
Testing with dig ip address:

luzar@ubuntu:/etc/bind$ dig -x 192.168.1.3

; <<>> DiG 9.4.2-P2 <<>> -x 192.168.1.3
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35746
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1,
ADDITIONAL: 0


;; QUESTION SECTION:
;3.1.168.192.in-addr.arpa.       IN  PTR


;; ANSWER SECTION:
3.1.168.192.in-addr.arpa. 604800 IN  CNAME  ubuntu.example.com.


;; AUTHORITY SECTION:
example.com.            86400   IN   SOA   ubuntu.example.com.
root.example.com. 2008112202 604800 86400 2419200 86400


;; Query time: 0 msec
;; SERVER: 192.168.1.3#53(192.168.1.3)
;; WHEN: Sun Nov 23 04:32:09 2008
;; MSG SIZE  rcvd: 115
luzar@ubuntu:/etc/bind$

If you have an error during configuration, please check error logs in:


  • /var/log/daemon.log.

  • /var/log/messages.
Here is an example of /var/log/daemon.log:
luzar@ubuntu:/etc/bind$ tail /var/log/daemon.log

Nov 24 10:23:05 ubuntu named[4554]: zone 28.172.in-addr.arpa/IN:
 loaded serial 1
Nov 24 10:23:05 ubuntu named[4554]: zone 29.172.in-addr.arpa/IN:
 loaded serial 1
Nov 24 10:23:05 ubuntu named[4554]: zone 30.172.in-addr.arpa/IN:
 loaded serial 1
Nov 24 10:23:05 ubuntu named[4554]: zone 31.172.in-addr.arpa/IN:
 loaded serial 1
Nov 24 10:23:05 ubuntu named[4554]: zone 168.192.in-addr.arpa/IN:
 loaded serial 1
Nov 24 10:23:05 ubuntu named[4554]: zone 1.168.192.in-addr.arpa/IN:
 loaded serial 2008112302
Nov 24 10:23:05 ubuntu named[4554]: zone 255.in-addr.arpa/IN:
 loaded serial 1
Nov 24 10:23:05 ubuntu named[4554]: zone example.com/IN:
 loaded serial 2008112202
Nov 24 10:23:05 ubuntu named[4554]: zone localhost/IN:
 loaded serial 2
Nov 24 10:23:05 ubuntu named[4554]: running

Ubuntu mkdir permission denied

I was trying to mount dvd-rom in Ubuntu server yesterday. So I create a directory named dvd under /mnt directory. I always create a different directory for different devices I mount into my Linux system such as usb thumb drive, external hard disk, etc. So I try to do the same in Ubuntu, but I got this ubuntu mkdir permission denied warning though.
Ubuntu mkdir permission denied warning:
luzar@ubuntu:~$ mkdir /mnt/dvd
mkdir: cannot create directory `/mnt/dvd': Permission denied
luzar@ubuntu:~$


I have permission denied warning. That means I don't have permission to create directory in /mnt directory. So here's what I do:
luzar@ubuntu:~$ sudo mkdir /mnt/dvd
[sudo] password for luzar:
luzar@ubuntu:~$ ls /mnt
dvd


If you are using other Linux distributions, probably you are doing your job as root. In Ubuntu, the safety precaution has been taken, where in default installation, root account has been disabled. So user just create a normal user during the installation. Of course the root account is created by default in all Linux installation, and so does in Ubuntu.

The ubuntu mkdir permission denied issue has been solved. We learn a useful tips here. Please remember, in Linux, the warning message is important because it tells us what the problem is.