0

[SOLVED] “Could not reliably determine the server’s fully qualified domain name, using … for ServerName”

You might probably faced the same following error while you were restarting the Apache server on Ubuntu.

$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2                                                apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
… waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

To fix that problem, you need to edit the httpd.conf file. Open the terminal and type,

$ sudo gedit /etc/apache2/httpd.conf

By default httpd.conf file will be blank. Now, simply add the following line to the file.
ServerName localhost

Save the file and exit from gEdit.

Finally restart the server.
$ sudo /etc/init.d/apache2 restart

References: http://russenreaktor.wordpress.com/2010/04/17/solved-“could-not-reliably-determine-the-server’s-fully-qualified-domain-name-using-for-servername”/
 
 
0

Javascript date function

var today = new Date()
var day = today.getDate()
var month = today.getMonth() + 1
var year = today.getYear()
day = day.toString()
month = month.toString()
year = year.toString()
if (day.length == 1) {day = '0' + day}
if (month.length == 1) {month = '0' + month}
document.write(year + month + day)"
0

Javascript validation for URL

function is_valid_url(url)
{
return url.match(/^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/);
}

0

Getting checkbox values in POST (PHP)

<html>

<head>

<title>checkbox help</title>

</head>

<?

 

if (isset($HTTP_POST_VARS)) {

 

$fruit = $HTTP_POST_VARS["fruit"];

 

echo("Fruits chosen: " . count($fruit) . "<br><br>");

 

if (count($fruit)>0) {

echo("You chose the following fruits:<br>");

}

 

for ($i=0; $i<count($fruit); $i++) {

echo( ($i+1) . ") " . $fruit[$i] . "<br>");

}

}

?>

<body bgcolor="#ffffff">

 

<form method="post">

Choose a fruit:<br><br>

<input type="checkbox" name="fruit[]" value="apples">apples <br>

<input type="checkbox" name="fruit[]" value="oranges">oranges <br>

<input type="checkbox" name="fruit[]" value="peaches">peaches <br>

<input type="checkbox" name="fruit[]" value="mangos">mangos<br>

<input type="submit">

</form>

 

</body>

<html>

0

Email format validation in Php using regular expressions

never ever include filename which you are including in htaccess url

example: RewriteRule ^admin/profile /admin.php?file=profile [NC]

in this first name after “domainname or ^ ” and filename you are using for reference is same

“ ^admin/” = “/admin.php?file=profile”

so give another name for filename reference.

like this RewriteRule ^admin/profile /master.php?file=profile [NC]

it worked.

0

.htaccess handling at godaddy hosting or any hosting. Tips to remember

never ever include filename which you are including in htaccess url

example: RewriteRule ^admin/profile /admin.php?file=profile [NC]

in this first name after “domainname or ^ ” and filename you are using for reference is same

“ ^admin/” = “/admin.php?file=profile”

so give another name for filename reference.

like this RewriteRule ^admin/profile /master.php?file=profile [NC]

it worked.

0

Redirect from BlogSpot to website

<meta HTTP-EQUIV="REFRESH" content="0; url=http://bradsblog.net/">

 
Copyright © SERVER CODES