Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
[QUOTE=Kameshoga;31386416]What's the best program to use to start creating your own website?[/QUOTE]
Notepad
[QUOTE=Kameshoga;31386416]What's the best program to use to start creating your own website?[/QUOTE]
[URL="http://notepad-plus-plus.org/"]Notepad++[/URL] (Windows)
[URL="http://www.sublimetext.com/2"]Sublime Text[/URL] (Windows, Linux, OSX)
[URL="http://macromates.com/"]Textmate[/URL] (OSX)
[URL="http://www.panic.com/coda/"]Coda[/URL] (OSX)
[URL="http://macrabbit.com/espresso/"]Espresso[/URL] (OSX)
So, I'm attempting to move to my first "live" site. I uploaded my index to my webhost, just to see if it worked, but instead of displaying it the file is downloaded. I've spent a few hours messing with it but only appear to be making things worse.. Mind pointing me in the right direction? (I'm on an apache server if it helps at all.)
are you sure it's a .HTML or .HTM or .PHP file?
[QUOTE=Ac!dL3ak;31401663]are you sure it's a .HTML or .HTM or .PHP file?[/QUOTE]
It's .php, but I've also tried the default .htm file that came with the hosting, but now that also downloads instead of displays.
[QUOTE=Meep Moop;31401689]It's .php, but I've also tried the default .htm file that came with the hosting, but now that also downloads instead of displays.[/QUOTE]
link or something?
[QUOTE=Ac!dL3ak;31401704]link or something?[/QUOTE]
PM'd.
[QUOTE=Meep Moop;31401740]PM'd.[/QUOTE]
[quote]
Accept-Ranges:bytes
Content-Length:4813
Content-Type:application/x-httpd-php
Date:Fri, 29 Jul 2011 05:06:01 GMT
Etag:"512031-12cd-4a927d056a2c0"
Last-Modified:Thu, 28 Jul 2011 21:26:11 GMT
Proxy-Connection:Keep-alive
Server:Apache/2.2.9 (Debian) mod_wsgi/2.5 Python/2.5.2
[/quote]
looks to me as if you don't have PHP, unless you removed the header tag with a .htaccess.
[QUOTE=Ac!dL3ak;31401842]looks to me as if you don't have PHP, unless you removed the header tag with a .htaccess.[/QUOTE]
Haha, oops.. Thanks.
Ok I give up on scrollTo, fuck this, too much trouble.
Next question: How do I make a scrollbar that only scrolls a certain part of my web page, not the entire thing?
[QUOTE=NotMeh;31405958]Ok I give up on scrollTo, fuck this, too much trouble.
Next question: How do I make a scrollbar that only scrolls a certain part of my web page, not the entire thing?[/QUOTE]
You would want to try the [url=http://www.w3schools.com/cssref/pr_pos_overflow.asp]CSS Overflow property[/url] for that.
[QUOTE=Kirth;31406327]You would want to try the [url=http://www.w3schools.com/cssref/pr_pos_overflow.asp]CSS Overflow property[/url] for that.[/QUOTE]
Ah, I see.
Thanks.
Anyone here use mysql replication before? I was going to use it because a remote server needs to do ~2-3 queries per second on a database and it seems like this would be a good instance to use it. Does it support ssl? Also are there any managers for setting it up?
[QUOTE=high;31417640]Anyone here use mysql replication before? I was going to use it because a remote server needs to do ~2-3 queries per second on a database and it seems like this would be a good instance to use it. Does it support ssl? Also are there any managers for setting it up?[/QUOTE]
people have done 750,000 queries per second on the one server, i don't think 3 is a problem
[editline]30th July 2011[/editline]
fyi, anyhub does 54 queries per second on an intel atom
I'm having a HTTP problem .
I send a server the following request
[code]
GET //res/img/icons/facebook.jpg HTTP/1.1
Host: demotywatory.pl
[/code]
but I get the following response
[code]
HTTP/1.1 200 OK
Server: nginx/0.8.53
Date: Sat, 30 Jul 2011 11:40:19 GMT
Content-Type: image/jpeg
Content-Length: 1085
Last-Modified: Fri, 29 Oct 2010 14:59:08 GMT
Connection: keep-alive
Keep-Alive: timeout=60
Expires: Tue, 09 Aug 2011 11:40:19 GMT
Cache-Control: max-age=864000
Accept-Ranges: bytes
*ě*Ó
[/code]
it gives me *ě*Ó at the end for every website I try.
this doesn't happen to .js or .css files I guess because they are small
[QUOTE=tagnara;31420791]people have done 750,000 queries per second on the one server, i don't think 3 is a problem
[editline]30th July 2011[/editline]
fyi, anyhub does 54 queries per second on an intel atom[/QUOTE]
I meant I would be doing 3 per second remotely. Also if the remote server goes down I don't want the server not being able to do anything.
What would be the optimal web server on Linux to host a Django site on? nginx?
[QUOTE=thf;31427658]What would be the optimal web server on Linux to host a Django site on?[/QUOTE]
probably something that can speak wsgi
[QUOTE=thf;31427658]What would be the optimal web server on Linux to host a Django site on? nginx?[/QUOTE]
use nginx to proxy through to this [url]http://gunicorn.org/[/url]
So basically, I'm a complete amateur who just started with HTML writing just for the hell of it.
I've encountered a problem. What element am I supposed to use to properly size the tables, texts etc. on the webpage? If I use for example "<table size = "500px">" it looks fairly normal on a bigger resolution, but on a lower resolution, it's fucking huge.
If I use "<table size = "80%"> " It's still fairly normal on a big resolution, but becomes extremely small on a low one.
So what am I supposed to do to make it look good no matter what resolution the viewer might use?
[QUOTE=RixxzIV;31429099]So basically, I'm a complete amateur who just started with HTML writing just for the hell of it.
I've encountered a problem. What element am I supposed to use to properly size the tables, texts etc. on the webpage? If I use for example "<table size = "500px">" it looks fairly normal on a bigger resolution, but on a lower resolution, it's fucking huge.
If I use "<table size = "80%"> " It's still fairly normal on a big resolution, but becomes extremely small on a low one.
So what am I supposed to do to make it look good no matter what resolution the viewer might use?[/QUOTE]
use <div>s and change the width by either using syle or css it's easier and loads faster.
[QUOTE=H4Z3Y;31428995]use nginx to proxy through to this [url]http://gunicorn.org/[/url][/QUOTE]
Why proxy it through nginx?
[editline]30th July 2011[/editline]
[QUOTE=zzlawlzz;31429269]use <div>s and change the width by either using syle or css it's easier and loads faster.[/QUOTE]
It's also much more supported by standards.
[QUOTE=thf;31429326]Why proxy it through nginx?[/QUOTE]
[quote]Although there are many HTTP proxies available, we strongly advise that you use Nginx. If you choose another proxy server you need to make sure that it buffers slow clients when you use default Gunicorn workers. Without this buffering Gunicorn will be easily susceptible to denial-of-service attacks. You can use slowloris to check if your proxy is behaving properly.[/quote]
[url]http://gunicorn.org/deploy.html[/url]
[editline]30th July 2011[/editline]
that's why
Sure, but doesn't Green Unicorn listen on the port itself... ?
[QUOTE=thf;31429552]Sure, but doesn't Green Unicorn listen on the port itself... ?[/QUOTE]
you have gunicorn listening on say, port 8000, and nginx running on port 80. When nginx sees a request meant for the django app it goes "oh, I should send this off to gunicorn" and [i]proxies[/i] the request through to port 8000
really, you shouldn't have to ask that, instead you should read the link I posted, it's all in there.
[editline]30th July 2011[/editline]
if you use unix socks instead of ports then you proxy through to the unix sock, not the port.
this is all shown here...
[code]
upstream app_server {
server unix:/tmp/gunicorn.sock fail_timeout=0;
# For a TCP configuration:
# server 192.168.0.7:8000 fail_timeout=0;
}
[/code]
[url]http://gunicorn.org/deploy.html[/url]
Oh, now it all makes sense. Thanks.
Anyone know of a guide for optimizing php? With only about 60-100 people on my site at once the load shoots up. Also whenever a page is requested you can see php shoot up to 20-50% cpu usage. I did install xcache but is there anything else that can be done to help?
Do some profiling and figure out where you need to optimize more: [url]http://particletree.com/features/php-quick-profiler/[/url]
[QUOTE=KmartSqrl;31433311]Do some profiling and figure out where you need to optimize more: [url]http://particletree.com/features/php-quick-profiler/[/url][/QUOTE]
Thanks but I meant more of optimizing php itself and not the scripts. I imagine with the default settings there is room for improvement.
[QUOTE=high;31433673]Thanks but I meant more of optimizing php itself and not the scripts. I imagine with the default settings there is room for improvement.[/QUOTE]
profile and see, most likely there's something wrong with the script.
Sorry, you need to Log In to post a reply to this thread.