Tag Info

Hot answers tagged

14

You could do this: Work with mod_rewrite to change requests from /some/static/page.html to /htmlinjector.php?url=/some/static/page.html then use PHP (or whatever you find appropriate) to do the file-manipulation. Add an output cache to improve performance. As an alternative, Apache Handlers sound helpful: Modifying static content using a CGI ...


10

Error pages should always be served with the correct status codes.


10

For Apache, there is the module mod_asis, which does just that - reads the file and sends it on its merry way as a complete HTTP response. This module is shipped with Apache by default, but you need to enable it first (see the docs, there's a reasonable example).


9

Honestly? Hire someone to manage your server. If you have a 1.3 TB database, cPanel is not for you. Given the amount of data, you're going to need a pretty optimized MySQL server in order to get anywhere near acceptable performance. cPanel is not exactly ideal for very large websites (it severely limits the amount of serverside settings you can change ...


9

Yes. There are hundreds, perhaps thousands of database servers available to you. To be frank, if you haven't been successful in getting MySQL working on Ubuntu, you're either: Reading really bad documentation Reading good documentation but not understanding/executing properly Giving up too soon MySQL should be trivial to get running on Ubuntu. Quite ...


9

You need to tell the MUA that the content contains HTML. Traditionally this is done using MIME. Try adding the following header lines to your message: Mime-Version: 1.0 Content-Type: text/html You may need to add a Content-Transfer-Encoding header as well. The Wikipedia page on MIME has more details, including links to relevant RFCs. Update: This worked ...


8

Personally, I think nginx provides the right split between the things it does itself (receiving and processing HTTP requests) and what it delegates to other processes (dynamic page generation). Whilst it is less effort to setup Apache to serve PHP requests, running everything within Apache is a bit of a security and configuration problem (all files that are ...


8

I hate to be blunt, but if you need to ask, then you probably aren't the person who should be deciding.


8

I am not sure why this hasn't been mentioned in the list of answer. Sorry if it took me 2 years to see this question... The easiest, most powerful way to do what you want to do what you want is using an Apache filter. Just have: ExtFilterDefine css_changer mode=output intype=text/html cmd="/some/php/script.php" SetOutputFilter css_changer A possible ...


8

The biggest one I hear is testing legacy code against a new version. With so many companies having internal web applications which they haven't touched for a while, they often site system instability and the high cost with testing all the production systems against a new version. It's also difficult to get any large organization to do anything faster than ...


7

Have you seen wkhtmltopdf? Can't say how well it works personally, but it seems like exactly what you need. Only problem may be, with this and any 'browser automation' solutions, that it will pick up the print stylesheet rather than the screen display one so the PDF may not be exactly what you see on screen.


7

Have you considered installing Lighttpd? It sounds pretty much like what you need. Also look at the package details for Ubuntu and the article on Softpedia. Possibly ignoring the PHP and MySQL references? Edit: after installing the web server, do what RainyRat has suggested ;)


7

Try http://www.lighttpd.net/ Lighttpd, Its used by Google,Sourceforge and a other large organizations. Its pretty small and has been know to have the edge over speed all in this one small box.


7

Google analytics To handle large log files, you might want to look into log rotators: http://www.cyberciti.biz/faq/how-do-i-rotate-log-files/


7

PHP is well suited to this. This example requires PHP 5: cat file.html | php -R 'echo html_entity_decode($argn);'


6

Perl is (as always) your friend. I think this will do it: perl -n -mHTML::Entities -e ' ; print HTML::Entities::decode_entities($_) ;' E.g.: echo '"test" & test $test ! test @ # $ % ^ & *' |perl -n -mHTML::Entities -e ' ; print HTML::Entities::decode_entities($_) ;' With output: someguy@somehost ~]$ echo '"test" & test $test ! ...


6

nginx


5

The Webalizer is very good at mining your Apache logs for stats -- who visits, from what IP addresses, a breakdown of the kinds of domains those IPs reverse-resolve to (.com, .net, .co.uk, .ru, etc.), what their browsers claim to be (which is usually, though not always, what they actually are), what operating system the user is using (again, provided the ...


5

SSL has nothing to do with your php or html-pages. It's encryption of communication between (web-)server and client (usually a webbrowser) on the application layer. The way to set it up depends on the web-server used. To cover the two most popular servers: Van's Apache SSL/TLS mini-HOWTO How To Set Up an HTTPS Service in IIS SSL-Certificates need to be ...


5

The solution is actually in the code of your web pages and not in any configuration that you can do. Presuming that you are using JSP to generate your HTML, you need to change links like this: <a href="/home">a link to the root of my webapp</a> To look like this: <a href="<%= response.encodeURL(request.getContextPath() + "/home") ...


5

While varnish is absolutely fantastic with it's flexible VCL, it's really more suitable for caching dynamic websites. There seem to be general consensus about nginx outperforming varnish (atleast on small static objects). You can either proxy_cache, fastcgi_cache or simply serve from disk directly using nginx. I know it do support memcached, but the only ...


5

The author of nginx says that nginx is aimed on serving static files and being frontend, forwarding request which require dynamic pages to other servers like apache. Another good idea is to cache apache's dynamic request with nginx if data is rarely updated, for example, an archived blog post.


5

You need to talk to the support team of the other site. Hotlinking "protection" is done by analysing the Referer: field of the HTTP request. When an image on one site (one.example.com) is linked from another site (two.example.com) like this: <img src="http://one.example.com/image.jpg"> The Referer: field of the image request is set to Referer: ...


5

Typical Web filtering appliances/services classify web sites into categories, and then each category is permitted or blocked based on corporate policy. Some, such as Barracuda, use a reputation based system. They almost always also allow for local exceptions. So, if you host the jQuery code on your own site, it will be permitted or blocked the same as the ...


4

CDNs mostly save you bandwidth and latency (by placing the content closer to the user). If they end up saving you significant amounts of CPU time or memory, that's usually going to mean that you aren't scaling to the number of users, or there's a sub optimal webserver config in place. When dealing with load problems, you really have to identify the exact ...


4

change: header('login_success.php'); to: header('Location: login_success.php'); Also, session_start() is a common source of errors, often due to permissions. Turn on error reporting with: ini_set('display_errors', 1); error_reporting(-1);


4

Make sure you have: A CNAME record in your DNS settings so that www.getfitcore4.com (CNAME) points to getfitcore4.com (A). A web server set up to handle requests at www.getfitcore4.com, not just getfitcore4.com.


4

Here is a tutorial on how to use mod_proxy_html to edit the links on a webpage ( the content). You might be able to apply this modify the html you want. UPDATE: Are you sure you want to go this route? I think Apache is meant to serve content, not create it. This would probably go in the view part of a MVC framework. The reason I wouldn't recommend this ...


4

I hate to be vague but, either will work. Choose whichever OS that you are most comfortable with.



Only top voted, non community-wiki answers of a minimum length are eligible