Jump to content

the_oliver

Members
  • Posts

    364
  • Joined

  • Last visited

    Never

Everything posted by the_oliver

  1. Hi, im trying to configure virtual hosting, under Apache 2 on a Linux centOS box.  What i wand is for it to be able to cope with mass vertual hosting, with out me having to  eddit the conf each time i add a new site.  I did some resurch and found i can do this through the using the  mod_vhost_alias function, and the code pasted below.  I think that is is supposed to work so that all i have to do is create a file with the sites name and it will look for this when a request is made: [code]# get the server name from the Host: header UseCanonicalName OFF # this log format can be split per-virtual-host based on the first field LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon CustomLog logs/access_log vcommon # include the server name in the filenames used to satisfy requests VirtualDocumentRoot /var/www/html/%0/docs VirtualScriptAlias /var/www/html/%0/cgi-bin [/code] So i posted this at the bottome of my httpd.conf and restarted apache.  However whenever i try it i get: The requested URL / was not found on this server. What have i missed?  Sugestions would be gratley appreshaited. Thanks! (oh: [quote][root@host.net]# httpd -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: _default_:443          bla.bla-bla.net (/etc/httpd/conf.d/ssl.conf:88) Syntax OK[/quote] )
  2. Firstly can you tell us what opperating system your doing this on?  Cant realy tell you too much with out knowing this! As to a few of the other questions. The host name for apache is the same as the host name for the computer.  For example www.testing.com but by the sounds of it you should enter your IP address hear.  Commonly the username and password will be the username and password you use to log into the computer noramly.  However it is possible that you may not have 'permision' to edit that folder.  That is dependant on the operating system, and ftp client you are using.  Alternitivly, if your using windows you can simply drop the files into the directory your web server reeds from.  This will be stated in your config.  When it says 'your host should give you'  this meens basicaly meens the persion who is runnig the server, in this case you! Setting up these things for the first time is often somewhat daunting!  But it becomes logical after a while!
  3. Robots/Bots/Spoders/Whatever are obliged to obay a robots.txt  file telling them what they can or cannot look at. Create a file called robots.txt in the root directory of your site.  The file works like this: To stop all robots seing anything: User-agent: * Disallow: / To stop google seeing anything User-agent: google Disallow: / To stop any robots/spiderbots seeing into particular foolders: User-agent: * Disallow: /cgi-bin/ Disallow: /testfile/ Simply paste these as you feal into robots.txt and they will look there first to see what they can or cant do. Hope that helps
  4. You need to point out a database in the config.inc file, or if you did there a typo, or you havent set the correct permitions on the database.
  5. Cant reraly see from that.  Can you post the whole queiry please.
  6. This but is much easyer.  This is done though your router.  The router needs to be set up to forword all requests on port 80 for that IP address to be forworded to your internal ip address.  It is important however that your internal ip address is also static.  EG always 192.168.1.1 .  Most routers have a web based admin or something to make setting this sort of rule up realy simple.  If you can figure it out let us know what type of router it is. As to telling the domain holders to set up to a-record, most of them will have a controle pannal on the web page to alow you to alter the DNS infomation stored on there servers.  Best thing to do would be to email/call there tech suport and ask. Good Luck!
  7. You have to store the uses ID some how, and use this to pole the database for the users last know session number.  And yes if it does not match with the users current session number then you have a page saying that they were logged out for security resions and to log back in. *roopurt18 How does using date/time stamp stop more then one user being logged in?  Why could two people not log in at the same time, with the same user name, and both be updting the time stamp. and [quote]is seen in the URL or in a cookie which can easily be given to another user[/quote] sorry but this is rubbish!  The session is not displayed in either of these.  Althogh it is possible for the session to be found it is not possible to replicate it.  Sessions would be infinatly more secure then a date/time stamp. When they try to log in there is no need to check for a previus session.  Just write in the number of the current one.  Anyone using the old session will be logged out.  Also if you use the date/time method there is a delay while wating for cron.  This way there is no time delay till they can log in again.  The only way there session number will change if they exit the browser.  This also meens if they exit the browser, no one can use the computer strait after them and find the user still logged in!
  8. can your server resolve address propaly?  for example if you type ping [i]anotherdominname.com[/i] does it find the ip address and get a responce?
  9. If its in the same file system on the same server you can just refer directly to the file, even though its on a differend domain.  Eg ../send.php However if your running it with a full http:// addrerss it should work.  Perhaps you could post your code?  It could also be that your server is not likeing the multiple connections if your not 'vertual hosting' but is unlikly!
  10. Running your own name server is a bit complex, and normaly you would run two for redundancy.  It would be much simpler if you had the people who hold your doming name (the regestra) held the dns record, and just pointed the A-Record for www to your server.  Most do this as included in the price.  Is there any particular resion why you wish to host your own name servers?
  11. I do this by recording there session number in a database.  Every time they log in the session number is updated agains there username.  The for a secure area i check there users session number against the one in the database, and if they dont match, the user has to log back in agian.  As the session number will always be unique, it insures the user can only be logged in once.  The other way to do it is through cookies.  As the the seeing who is logged in, you can also do this through having a database marked with the login time.  Have a task remove the time when they log-out, or after a serten period of inactivity.  Perhaps these ideas could be of use to you?
  12. insted of php code you meen?
  13. perhaps th previos DNS thing i said in the last post did not make sence?  If theres no DNS server set up on the ip address for ns1.newguy45.com it simply wont work as a domain!  DNS is there so you dont have to remember the number.  I think you may find it very helpfull to do a little basic resurch on how DNS works (its kind of fundemental!)  The people who regestered your domin can almost sertinatly help. As [i]mathymus[/i] mentions if you have a router you need to set up a port forwording rule to your internal ip address, which must remain fixed. if not then you need to give your computer the external ip address, althogh this is a security risk.  The most important this is that ns1.newguy45.com is a proper DNS server or you will get no-were.
  14. [quote] chick for sendmail path in the phpinfo.html it was correct[/quote] If the php from did not spit out any errors then it is likley to be that your server is not set up to send mail correctly.  One common resion for this is that the server can not resolve address propaly?  Have you specified DNS server? In the comand line try to ping something like www.phpfreaks.com and see weather it resolves them?  - Let us know. Can you try running the folowing code insted: [code] $success = mail("you@whatwhatever.com", "testmail", "somecontent", "From: <jim@jim.com>"); if ($success) {   print "Sent fine"; } else { print "Not working"; }[/code] Works on mine so im hoping it might on yours! Lastly try these to things: check sendmail is running: something like: service sendmail status (not sure what OS your running And post the last fiew lines of your send mail log.  somthing like nano /var/log/maillog i guess.
  15. Looking at the link hat you pasted i thing that maybe you are a little confused about DNS, and it is not a apache problem? (apologies if im wrong and your some kind of god on it, but the domain name suggest other wise!!!! just ignore the rest if so.) I wont go into the detail of DNS as it is a monster topic, but hears a very simplified pointer. ok, so firstly this bit [code]ns1.newguy45.com. [71.76.239.163] [TTL=172800] [US] ns2.newguy45.com. [71.76.239.163] [TTL=172800] [US][/code] The ns1 and ns3 should be different servers, for redundancy, and thus have different ip address.  The ns, (name server is the bit that does the work about your domain). The propos of it is that it takes the address that’s being looked at (eg www.newguy45.com) and tells the user/Brower/computer what the IP address of the server where the information is stored is.  In this case it would be through what is called an A-record. For example the computer side of it would look a bit like this: (some one sesnt this to me and I quite like it!) Some one types in www.newguy45.com into a web browser Web Browser: Does any one know where to look for the domain information for the domain newguy45.com? Top level DNS server:  Sure the information is listed on this ns1.newguy45.com DNS  server.  Its address is 10.5.2.123. Web Browser:  Hello 10.5.2.123.  Could you tell me the ip address for prefix www.  on the domain newguy45.com. ns1.newguy45.com: Sure www. Refers to the ip address 71.76.239.163. Then the web browser would look at the ip address and get the information from it.  A basic understanding of DNS is very useful, research it on goggle. Essentially the problem is that you are not running DNS servers.  Most people don’t unless thry are hosting hundreds of domains.  So ns1 and ns2.newguy45.com should pointing to someone else’s DNS server who will store the information for your domain.  I would imagine the people who registered the domain for you can do this. They will then create an A-record saying that the www.newguy45.com information is hosted on 71.76.239.163 computer.  I would strongly advise you not to host you own DNS servers with out a substantial amount of time and know how.  It would also require you that have a fail safe power and web connection for them.  All in all a lot of work!  What you need to do is change the ns1 and ns2 address to point to somewhere else! Hope this helps and I didn’t miss the point. Sorry it’s a little long winded!
  16. Hello.  I was wondering if there was a way to get php to interact with a comand line?  For example to have a function that would run 'sevice --status-all' or restart a service in a comand line, and return the responce? Thanks
  17. perhaps you can put a non-critical vertion of your script (a demo) on a site thats not in use and just ask people to have a go!  should soon expose any week points.  One of the main areas of weekness can be not in your code, but in the way the permitions/firewalls/what ever access restrictions your using, are set up.  Such as dissabling anonomus ftp etc. 
  18. If its on hosting then it allmost sertinatly will.  When you origionaly set up a web server, it is not nessesery to have all the php moduals installed.  Its sort of an optional extra realy.  For example most webservers will not suport pg_ connections by default.  You will find that although alot of people use it, you still have to specificly install the options. Like i said though if your on paied hosting it almost sertinatly be configered. **sorry just noticed you  said your on paid hosting on the first post! Perhaps you could try putting something allong these lines above your first $bio (the queiry). [code]if ( ! $link ) die( "Couldn't connect to MySQL" ); mysql_select_db( $main ) or die ( "Couldn't open $db: ".mysql_error() ); [/code] other thing that might be worth a try is adding ' before and after each part: eg: [code]SELECT 'text' FROM 'about_bio' LIMIT 1 (not sure if the 1 would need it or not). [/code] It unlikly but some systems, espesialy the older version can insist on it? Let me know how it goes.
  19. I would place money on if being an option in the config.  Mine lives in /etc/mail/sendmail.mc Try altering that and then make it. Strange thing is that the server should regard it as a local user trying to send mail.  It will receve the message from the local apache user on your mashine.  Can you send mail from the apache account?  (loggin as root, su apache etc).  That could shed lighit on the area! Im leaning more towords it being  a code thing.  Perhaps your sendmail is asking for authorisating?
  20. Have to ask the odvious, is your php compiled with mysql function support?
  21. Your assuming that the server its sendin from is set up to send mail itself. Is it?  Perhaps you have to define a mail server?  Post your errors.
  22. There are hundreds of free countes out there, where you simply passed in the code your given, and then can go to the creators site to see stats, or have it display at the bottom. The other way would be to have a database field increment.  This could be done by trigering a function or something everytime the page is opened.  Also you could have it add and check for the users IP address so as to ensure you only conut a user once, not the same user opening and closing the page 100 times!
  23. Thats because by using body the seccond time you are redefining it not addin to it.  There are two ways that you can do this.  This first is by adding a period after the body variable for each new part.  The period is simply joining the 'new' body deffinition onto the end of the orijional definition: [code] $Body = ""; $Body .= "Name: "; $Body .= $_POST['Name']; $Body .= "\n";  //MAKE A SPACE IN THE LINES (LIKE <BR>) $Body .= "Telephone: "; $Body .= $_POST['Telephone'];[/code] And you can keep doing this for as long as you like!  The other way is to just keep joining them into your origional line, as you did with the first one: [code]$mail->Body = "Name: ".$_POST['Name']." has the telephone number".$_POST['Telephone']." and lives in ".$_POST['Town']."ane etc";[/code] It is also possible to send HTML emails, so you can include images, colours and a better layout.  If your intrested in this one, i asked how a fiew posts ago and got a good awnser, so just dig it out!
  24. how are the permitions set on the files?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.