Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by txmedic03

  1. Maybe it is just me, but that statement is hilarious. They are claiming to be a design company, among other things. *facepalm* They really should consider hiring a designer and a developer though. Perhaps fire the one(s) they have.
  2. Create a .htaccess file containing: RewriteEngine On RewriteCond %{HTTP_HOST} ([^\.])\.in$ [NC] RewriteRule ^\/(.*)$ /www/%1/$1 [R=301,L] Assuming that /www is actually in the root of the file system and not in /home/{username}/www like I imagine it actually is.
  3. Try something like: <?php require_once('/made/up/page/that/does/not/exist.foo.bar'); ?> If it is a 500 error you want then, provided your service provider has configured the server correctly for a production environment, requiring a non-existent page will throw a fatal (500) error.
  4. make sure services restart if they crash, periodic restart of server, load services on reboot or shortly there after...
  5. There are sections for things like HTML, CSS and JavaScript. Just wondering if any thought had been given to new sections or more specialized sub-sections for the existing sections. For example, there is a board for JavaScript, but then there are a few big libraries like jQuery and protoType. There is also AJAX, which is a fairly large topic in its own right. Someone who works exclusively with jQuery would be better equipped to help in a jQuery section than to read through tons of posts about protoType before reaching something they are comfortable assisting with. The same could go for CSS and its counter parts like SASS. I realize that there are topic tags and the primary focus of the site is PHP, but I see things broken down into sub-sections and some sections dedicated to topics which are in the broader spectrum adjacent to PHP, but not directly related to PHP. I also realize that you do have to draw a line in the sand somewhere or you end up having to change the name of the site to "everything freaks", so I guess really I had a thought and a curiousity whether it was something that was being considered or something that maybe crossed a line the site was not prepared to cross.
  6. I have been absent from the forums, with the exception of a brief return some months back, for quite a long time and figured that I would re-acquaint myself with the site. So..umm...'hello!'...again. For those who actually even read this section of the boards and are still reading this, in my absence, from the forums, I have continued to develop PHP and related web languages and added a few new ones to my list of toys to play with. I am also no longer an emergency medical technician or a phlebotomist. I became a Texas peace officer (cop) near the end of 2009 and worked for several years in law enforcement. I still maintain my license as a peace officer, but no longer work for a department in that capacity. I am now setting my sites on a return to college for a degree in networking. I once worked for a collection of companies doing various task, like troubleshooting hardware/software problems in home PCs and writing software for businesses. The companies were small businesses owned by the same people and each company was specialized in a particular IT field. The one company did PC repair where people brought in their computers and we resolved issues and on rare occasions a house call. The other companies dealt with things like hardware/software troubleshooting/repair for business, software/web development, business network maintenance/troubleshooting/repair/etc, etc. The companies, like I said, were all small and operated out of one office with just a handful of employees. I had gone to school with some of the owners prior to enlisting in the Marine Corps and they hired me based on their personal knowledge of me and what they knew I could do for them without a degree. I wrote software, repair computers and occasionally installed/troubleshot networks at businesses. I told you all that so you better understand why I feel like it is about time I got a degree in networking. I would not consider myself an expert in any area of IT, but I like to think that I am not a complete waste of space in a few. I'm getting older and computers constantly remind me of when I look at a system with 3Ghz+ on multi-core processor(s) and RAM measured in GB and then think back to the first computer I sat down in front of, as a toddler, the Macintosh series II. For those that aren't old enough to remember the early Macs, the series II had a 3.5" floppy drive, no internal storage, RAM measured in KB, a monochrome screen and it was accompanied by a dot-matrix printer. I look back on that machine with fond memories and I look to the future of computers with baited breath and the wide-eyed wonder of a child, anticipating what will happen next. I know I have not kept up with every little change and advancement, like a true geek should and I dread the day when I become that old guy who double-clicks EVERYTHING, has to hire a ten year old to turn his computer on for him and thinks his gmail is only on his computer at home, but I am not there yet and I feel I still have a few things to contribute in the fields of programming, networking and maybe a few others. That should be more than enough rambling from an old fart, so...how bored were you to sit and read all that? lol
  7. Need to confirm that GoDaddy allows mod_rewrite. It was previously mentioned that you have multiple nearly identical sites and the other two work in the expected manner. Are the other sites hosted with GoDaddy? Are the other sites separate accounts? Are the other sites using the same hosting package as the GoDaddy one that isn't working? Hosting packages typically come in three levels: Dedicated - You have a whole system all to yourself and you get ssh (or rdp for windows servers) access to configure and control the system with few or no guidelines for what you are allowed to do with the server. VPS (Virtual Private Server) - This is generally more restrictive than the dedicated servers, but does allow for quite a bit of control. These types of servers a virtual so you share resources of a physical server with multiple other VPS customers. Shared Hosting - These are the cheapest and most commonly used hosting packages. There is very little control over configuration and lots of restrictions on what you can do. You generally do not get RDP/SSH access and the resources are divided up for all the hosting packages hosted on that physical server. I am not extremely familiar with all the security minded restrictions that GoDaddy implements or if they offer anything other than shared hosting, but if you are on shared hosting then it is very likely that the options for configuration in the .htaccess file are very restrictive. The host can't afford to let you change anything that would negatively impact any other their other customers on that server and they can't spend all their time customizing configurations for each customer, so you get a one size fits most configuration. Hosts typically set very strict guidelines on what you can change via PHP, .htaccess, etc. That's just what happens to spring to mind atm anyway. Please, forgive me if I have misunderstood your question or if I have done nothing more than re-affirm things you were already aware of.
  8. Well, as a matter of fact there are a few ways to go about it, lots of tutorials and it is pretty painless. If you want to use jQuery: http://www.9lessons.info/2009/07/auto-load-refresh-every-10-seconds-with.html I just googled for it and that was near the top of my results, but if you are interested in using jQuery that should be something along the lines of what you are looking for. Now, that being said, if for some reason you are trying to avoid jQuery or you want more information about what you are getting into then.... Okay so basically, you want a sort of live counter on your page to quantify the number of people currently on the page, right? If you have continued reading to this point then I'll assume that my google is weak or you have an aversion to doing things the easy way. The end result will be a sort of seemless reload of a small portion of the page whether anything has changed or not because AJAX is client-side and dynamically makes requests for updates of portions of the page when, or as often as, instructed to do so. Think of it like this: say you sent me a picture to my cell phone of a puppy or something. Now let's assume that I am actually interested in seeing new pictures when you take them because the puppy or whatever is just so adorable, so every 10 seconds or so I text you and ask for a picture. In this scenario, I am ajax and you are the webserver and the picture(s) are the small part of the page that I keep asking for updates on. There are alternatives which work that scenario in sort of reverse order and allow you to send me updates rather than me texting you incessantly for updates, but you came for AJAX, so we'll get back on the topic at hand. The gist of the setup is that you'll want to have your page which has the AJAX and nags the server for updates and has an element like a <span> or a <div> to put your counter inside and a page which has nothing except the SQL query and displays the counter that you want to drop into your HTML element. I'll assume that you don't need me to really go over javascript timing functions and just go over the actual AJAX code, but if you need some info on the timing functions then ask google about "setInterval javascript". I have a sort of cookie cutter function that I typically just tweak from project-to-project, so I'll just briefly go over it and hope your problem is resolved. function mnuClick(url) { var xmlhttp; /* Establish a variable to reference the fella that will be nag...err...um...making frequent, polite requests for updates from the server on our behalf. */ var content = document.getElementsByTagName('section')[0]; /* This is just how I found the specific element I wanted to fill with what the ajax is retrieving. */ /* Now we have to determine if the browser supports XMLHttpRequest() or his mentally challenged little brother the ActiveXObject("Microsoft.XMLHTTP") */ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } /* Now we'll just create a little function that fires when the ready state of our little buddy changes so we can display the stuff we request to the end-user(s). */ xmlhttp.onreadystatechange=function() { /* There are several states, but the only one that really matters is 4 which means for better or worse our little buddy is ready to tell us he got what we asked for or so he can tell us to take a long walk on a short pier. */ if (xmlhttp.readyState==4) { /* I used a switch here so I could organize various responses and react accordingly. The status is a number and it is either an error number like 404 (File Not Found) or if we are real lucky it is 200 which means we win. */ switch (xmlhttp.status) { case 200: /* Everything went well and we are ready to display the update. Just as a note here there is also an xml response if you are pulling down XML, but I've never need it or used it. */ content.innerHTML = xmlhttp.responseText; break; case 0: /* I found that when a site doesn't allow remote AJAX (pulling up content in AJAX from a different website) then I get this 0, so I tried to account for it by putting the page in an iframe. It is a dirty fix, but since this wasn't a big major production or anything, just a personal thing for me to use, so I used the quick and dirty fix. */ content.innerHTML = '<iframe seamless src="' + url + '"><h6>Your browser does not support iframes.</h6></iframe>'; break; default: /* If neither of the events above have taken place then we better throw up an error message. I use a regex to make sure I didn't encounter an error while trying to display an error thereby causing an infinite loop of fail */ if (url.match(/\/errors\//)) { /* A little console debug message to let the viewer know that I'm a big, lazy dummy and haven't put the appropriate error messages up. */ console.debug('Error 404 while attempting to show error page: ' + url); } else { /* Call this function recursively to display the error page. */ mnuClick('/errors/' + xmlhttp.status + '.html'); } break; } } } /* This last little bit here is what really gets the ball rolling and initiates our request. */ xmlhttp.open("GET", url, true); xmlhttp.send(); } Hopefully you can decipher my comments (It's really late, I'm really tired and I just added the comments in, so ymmv). The switch case you could swap out for a simple if then to check for status 200 since you aren't actually doing navigation on more substantial areas of the page...yet...Alternatively, you could change the cases or add some new ones to handle things like internal server errors and such. I hope this gets you on the right track and that my sleep deprivation has not resulted in superfluous mindless babbling (well at least not more than usual anyway).
  9. The login button being below the rest when everything else is in-line kinda bugs me. It looks lonely. The layout is very bland and has nothing that really jumps out at me and the way the story is formatted at the bottom...well the story is the main focus of the site, right? Why does it look less like the whole focus of why I came to your site and more like the fine print at the bottom of a contract? There isn't anything necessarily wrong with the layout, but it is bland. The login button is just a small thing that bugs me. The story blending into the rest of the site is the thing that most concerns me.
  10. The first page has large images that loaded slowly for me and where off-center. The log has a stark white background and a gradient behind it. It just doesn't fit well. That's as far as I could stand to go. Basically, the front page makes me write you off, not as a legitimate publisher, but as some kid in his room making a website about some magazine they like to read.
  11. I really just can't find anything good to say about the site. The layout is pretty horrific and it is because of the things that Adam mentioned about the corners, shadows, fonts, etc. The thing that stuck out, once I got past the layout disaster, was the the links in the middle to the 'shortened' urls. I realize it is probably just because this is a work-in-progress, but the links aren't to shortened urls, but rather direct links to the websites. On top of that, they are shorter than your version of the link. For the layout, think about what you are trying to achieve. You want A (as in the singular, one, uno, eine) website, but what you have here feels like multiple things have me by the arms and legs and are dragging me in different directions. Tone down the bevels, shadows and curves. Add padding so the text isn't crammed against the borders and trying to escape. If you are going to put things into separate boxes, at least make all the boxes line up better. It looks like you opened up Microsoft Paint and drew some boxes, without regard to the sizes of the other boxes, and then filled them with your site content.
  12. You can do an actual pop-up with just window.open(). Do you mean you want a <div></div> that you hide/show to appear to be a new window, but actually isn't a new window?
  13. I'd suggest dropping the W3C validators since clicking them just lists tons of errors and warnings about your CSS and XHTML. The header looks sparse and I'm not sure why I need to know currency conversion in the header of a news/sports site. There are small graphical inconsistencies in the section headers. The map at the bottom and the geolocation stuff are irrelevant to a news site. It seems like you found these nifty toys you couldn't wait to play with and included them where you didn't need them just so you could use them. Overall, the site is cleaner than a lot I've seen, but still has a lot of things that need to be done.
  14. Also if you don't have asp tags turned on in the php config then using <? ?> won't work. You have to use <?php ?> if your asp tags are disabled. I always use <?php ?> just in case I write some code that goes on a server that has the asp tags turned off. You will need to install a local server (google wamp) or upload the code to a host (google knows where lots of free hosts are) and point your browser at which ever server you chose to go with. If you go the route of wamp, copy your script(s) to C:\wamp\www, assuming you use all the defaults for wamp installation, and point your browser to http://localhost/your_file.php, as PFMaBiSmAd said, changing your_file.php for the actual name of your script. If you choose an online host they typically have an FAQ with the specific instructions for uploading to their server and how to reach the page once you upload it (IE. the url of your new file(s)).
  15. Set display_errors = On in your php.ini file. This is not recommended for production, but for development it is fine. Alternatively you can do: tail /var/log/apache2/error.log This will show you the last few lines of your error log file (the most recent error messages).
  16. Do you mean you want an IMAP server running on your CentOS system or that you want to be able to interact with imap servers via php scripts?
  17. I have had bad experience with running CentOS. It is a pretty solid distro and all, but some software does not build well on it. Ubuntu 12.04 minimal is LTS now and all the services I've installed on it were a lot less painful on Ubuntu than CentOS. When you are installing the server software and the developers list installation instructions for Windows, Mac OS x, Fedora, Ubuntu, SuSE and a handful of other linux distros then mention CentOS and say the software doesn't build well on CentOS, I take it as a sign that I should know when I'm beat and setup an Ubuntu box. If all you are doing is a basic web server with MySQL and PHP then CentOS will definitely work, but check into any and all services and which distro they run best on before you pick the one you are going to work with. VirtualBox is a great way to pick one and build up the server without needing an actual server or having to wipe out a computer to pull it off. Now as to your requirement for installing all these services individually...it depends on if you are doing dedicated managed or unmanaged hosts. If you are doing a shared level hosting reseller package then you wouldn't have to install any services at all (actually you wouldn't even have the option). If you do unmanaged dedicated servers then you provision the box with the specified OS with nothing more than OS and SSH and wish them the best of luck. If you are providing managed dedicated or VPS (Virtual Private Server) then you would likely be installing MySQL, Apache and PHP (LAMP - Linux Apache MySQL PHP). If your server of choice were Ubuntu you'd simply do apt-get install <packages> then tweak the configs and you are done. I'd just about be willing to bet that you wouldn't be doing a whole lot of windows servers, so installation on windows won't help you much and even if you do run a lot of windows servers, the majority of the time you'll find your customers are looking for Apache, MySQL and PHP or having the additional features won't hurt so...(WAMP - Windows Apache MySQL PHP) There is an installer package for windows which includes all of them and is quick and easy to setup. Bottom line: You put in some extra work you didn't really have to. It's great that you want to understand how to set everything up so you can better service clients, but no sense re-inventing the wheel.
  18. The frontpage entries may be there because the frontpage extensions are standard on the host. The Auth entries at the end should contain login information for http basic authentication.
  19. You are catching errors in the script that potentially has the errors...so what happens when the script dies a horrible death and it causes the error catcher to fail to execute? The errors should be in your apache2/error.log file. There's no need to try to log errors when they are logged for you once already. Chances are you have the display_errors in your php.ini set to Off and the server is throwing error 500 for ever major script error like missing {}(). You could try turning display_errors on and restarting apache. Then you might get to see your error messages. Failing that do a tail on /var/log/apache2/error.log and look for php errors.
  20. I've gotta go with trq on this one. Half an hour? WTF?! Why are you doing a half hour execution over http?
  21. What it sounded like the OP was looking for was to have the first server receive requests then process those requests and send new requests based on those requests through the firewall on a particular port. Once the intermediate server receives the response from the second server it packages it up all nice and pretty and returns it to the user. It seemed like just a plain proxy was not their intention. Now for the problem. Even if server #1 doesn't just forward all requests straight to server #2 (which would be done with port forwarding on the router), if server #1 gets 'hacked' it is a trivial thing to use it as a proxy to attack the second server and to know which ports are open. Server #2 would think all the requests were coming from server #1 since we would be accessing it via server #1, so attempts to restrict access to only that one machine would be futile. It is a convoluted plan for security that doesn't provide any real security at all.
  22. <VirtualHost *:80> ServerAdmin hostmaster@trekeffect.com DocumentRoot /var/www/trekeffect.com/trekeffect.com <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/trekeffect.com/trekeffect.com> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorDocument 403 /errors/403.html ErrorDocument 404 /errors/404.html ErrorDocument 500 /errors/500.html ServerName trekeffect.com ServerAlias *.trekeffect.com RewriteEngine on RewriteCond %{HTTP_HOST} !^(www).* [NC] RewriteCond %{HTTP_HOST} ^([^\.]+)\.([^\.]+)\.com RewriteCond /var/www/%2/%2/%1 -d RewriteRule ^(.*) /%1/$1 [L] </VirtualHost> Try this one on for size.
  • 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.