LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-02-2008, 12:09 AM   #1
mohan.aturheart
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Rep: Reputation: 0
Error in sub domain creation


Dear all,

I am calling a shell script file from php. This shell script file handles sub domain creation scripts.

I am given here the model script to create sub domain creation

In that for variable $droot we assign the path of folder in server.
$server_ip - IP address, $1 - subddomain value for example :xyz, in variable $4 - we assign the domain name for ex: - mohan.systems.com

touch /etc/httpd/clients/$1.$4.conf
echo "<VirtualHost $server_ip:80>" >> /etc/httpd/clients/$1.$4.conf
echo "ServerAdmin root@localhost" >> /etc/httpd/clients/$1.$4.conf
echo "DocumentRoot $droot/$1" >> /etc/httpd/clients/$1.$4.conf
echo "ServerName $1.$4" >> /etc/httpd/clients/$1.$4.conf
echo "ErrorLog logs/$1.$4-error_log" >> /etc/httpd/clients/$1.$4.conf
echo "CustomLog logs/$1.$4-access_log common" >> /etc/httpd/clients/$1.$4.conf
echo "</VirtualHost>" >> /etc/httpd/clients/$1.$4.conf
echo "<VirtualHost $server_ip:443>" >> /etc/httpd/clients/$1.$4.conf
echo "SSLEngine on" >> /etc/httpd/clients/$1.$4.conf
echo "SSLCertificateFile /etc/httpd/conf/ssl.crt/besdssacrt.crt" >> /etc/httpd/clients/$1.$4.conf
echo "SSLCertificateKeyFile /etc/httpd/conf/ssl.key/betaseddskey.key" >> /etc/httpd/clients/$1.$4.conf
echo "ServerAdmin root@localhost" >> /etc/httpd/clients/$1.$4.conf
echo "DocumentRoot $droot/$1" >> /etc/httpd/clients/$1.$4.conf
echo "ServerName $1.$4.com" >> /etc/httpd/clients/$1.$4.conf
echo "ErrorLog logs/$1.$4-error_log" >> /etc/httpd/clients/$1.$4conf
echo "CustomLog logs/$1.$4-access_log common" >> /etc/httpd/clients/$1.$4.conf
echo "</VirtualHost>" >> /etc/httpd/clients/$1.$4.conf
/etc/init.d/httpd reload


They raise the error in error log as - [warn] RSA server certificate CommonName (CN) `xyz.mohan.systems.com' does NOT match server name!?


and the subdomain is not reloaded. After we reload manually the website page get works.
 
Old 07-02-2008, 01:19 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
First, here is an example of a cleaner way to output, removing the extraneous echo's and redirections:

Code:
var1=cat
var2=dog

>output.txt cat <<-END
    this is
    multiline output
    $var1
    $var2
END
You don't need the initial touch command; the redirection takes care of creating the file. Finally, assign $1, $2, etc. to meaningful variable names, and use those instead, to be self-documenting.

Your CN name needs to match the name of the host.
 
Old 07-02-2008, 05:22 AM   #3
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Quote:
Your CN name needs to match the name of the host.
But if it doesn't, it can also run. The problem is that the navigator will inform to the user that it is possible there is an identity stealing attack. The user will need to "accept" the certificate to be able to navigate the SSL page.
 
Old 07-02-2008, 12:22 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
The point of security is not to keep ignoring nasty warnings that appear saying "There might be a security breach... you can ignore if you want"; users can't know a priori if a site admin has been lazy or incompetent.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware live CD Creation Error!!! somepalli Slackware 3 03-29-2008 03:00 AM
Multi-Server account creation or Domain accounts antony.booth Linux - Enterprise 5 01-17-2007 04:58 PM
DNS and Domain Creation louisb Linux - Enterprise 1 02-28-2006 03:16 AM
Domain creation on FreeBSd server gives error !!! apache Linux - Software 0 07-14-2004 06:18 AM
xf86config creation error CraigA Linux - Software 1 08-14-2001 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration