localhost-probleem

Vragen/antwoorden betreffende Linux / Unix

pjjb
Lid geworden op: 19 mar 2006, 00:50
Locatie: 9100 Sint-Niklaas

08 jan 2010, 15:36

't Is een hele tijd geleden dat ik hier nog een vraag stelde, maar dan nu toch weer:
als ik een html of php-bestand wil openen in localhost wordt dit bestand gedownload in plaats van geopend.
Waar zit de oplossing hiervoor?

mvg.

Paul
Linux (Ubuntu), ((XP))
Acer Travelmate 803LCI

hviaene
Lid geworden op: 05 apr 2004, 17:46
Locatie: Merksem

09 jan 2010, 09:14

pjjb schreef:'t Is een hele tijd geleden dat ik hier nog een vraag stelde, maar dan nu toch weer:
als ik een html of php-bestand wil openen in localhost wordt dit bestand gedownload in plaats van geopend.
Waar zit de oplossing hiervoor?

mvg.

Paul
Als je nu eens wat konkreter uitlegt wat en hoe je juist doet? Ben je bezig in een browser of een file manager, en welke dan? en wat wil je dat er met dat bestand juist gebeurd?

pjjb
Lid geworden op: 19 mar 2006, 00:50
Locatie: 9100 Sint-Niklaas

09 jan 2010, 17:01

Een beetje meer uitleg:
ik werk met
- Ubuntu 8.04
- Bluefish 1.0.7 (mijn editor voor html en php-bestanden)

Ik heb reeds meerder html en php bestanden aangemaakt en die werkten.

Het probleem stelt zich sinds een week of twee. Wat mij o.m. nog opvalt is: ik heb bijv. tikiwiki al veel langer geïnstalleerd en dit onlangs verwijderd; wanneer ik nu alleen http://localhost/ intik en activeer krijg ik als antwoord: "The requested URL /tikiwiki-3.1/ was not found on this server." Terwijl onder /var/www helemaal geen tikiwiki directory meer aanwezig is. Ik vermoed dus dat tikiwiki in een of ander conf-bestand (van apache???) werd ingevoerd en dat ook het gesignaleerde heuvel daar zou moeten (/kunnen) gezocht worden, maar mijn kennis reikt zover (nog) niet.

Paul
Linux (Ubuntu), ((XP))
Acer Travelmate 803LCI

wamukota
Lid geworden op: 13 dec 2004, 22:33
Locatie: Brugge

10 jan 2010, 06:12

Herinstalleer een tikiwiki.

Kijk dan of alles opnieuw normaal verloopt en als tikiwiki geen extra belasting of andere narigheden verkoopt, doe het dan zo verder.

BTW, als je wil experimenteren met nieuwe software edm, nooit op je production box werken. Ofwel via virtualbox ofwel op een andere machine.

Daar jij blijkbaar een LAMP servertje draait, moet je effe kijken naar Ubuntu Server 9.10. Hoe er wel rekening mee dat daar ales text-based is, maar hetgrote voordeel dat je alles manueel moet aanpassen is dat je veel leert over Apache, MySQL.

Ubuntu Server 9.10 is standaard 64-bit, maar via de download pagina kun je de 32-bit versie wel downloaden.

hviaene
Lid geworden op: 05 apr 2004, 17:46
Locatie: Merksem

10 jan 2010, 08:56

pjjb schreef:Een beetje meer uitleg:
ik werk met
- Ubuntu 8.04
- Bluefish 1.0.7 (mijn editor voor html en php-bestanden)

Ik heb reeds meerder html en php bestanden aangemaakt en die werkten.

Het probleem stelt zich sinds een week of twee. Wat mij o.m. nog opvalt is: ik heb bijv. tikiwiki al veel langer geïnstalleerd en dit onlangs verwijderd; wanneer ik nu alleen http://localhost/ intik en activeer krijg ik als antwoord: "The requested URL /tikiwiki-3.1/ was not found on this server." Terwijl onder /var/www helemaal geen tikiwiki directory meer aanwezig is. Ik vermoed dus dat tikiwiki in een of ander conf-bestand (van apache???) werd ingevoerd en dat ook het gesignaleerde heuvel daar zou moeten (/kunnen) gezocht worden, maar mijn kennis reikt zover (nog) niet.

Paul
Inderdaad, ik vermoed dat die tikiwiki nog als DocumentRoot staat in /etc/httpd/conf/httpd.conf (editeren als root, en dan httpd service opnieuw opstarten). Ik heb Mandriva, maar ik kan me niet goed inbeelden dat Ubuntu niet in dezelfde mappen werkt.

pjjb
Lid geworden op: 19 mar 2006, 00:50
Locatie: 9100 Sint-Niklaas

10 jan 2010, 15:22

Ik heb eens een reeks httpd.conf -bestanden bekeken, hier het resultaat:

/etc/apache2/httpd.conf:
ServerName localhost
-----------------------------------
usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-default.conf

#
# This configuration file reflects default settings for Apache HTTP Server.
#
# You may change these, but chances are that you may not need to.
#

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName Off

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of: Full | OS | Minor | Minimal | Major | Prod
# where Full conveys the most information, and Prod the least.
#
ServerTokens Full

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature On

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

--------------------------------------------------------------------------------
usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-manual.conf

#
# Provide access to the documentation on your server as
# http://yourserver.example.com/manual/
# The documentation is always available at
# http://httpd.apache.org/docs/2.2/
#
# Required modules: mod_alias, mod_setenvif, mod_negotiation
#

AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|pt-br|ru))?(/.*)?$ "/usr/share/apache2/default-site/htdocs/manual$1"

<Directory "/usr/share/apache2/default-site/htdocs/manual">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all

<Files *.html>
SetHandler type-map
</Files>

SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|pt-br|ru)/ prefer-language=$1
RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|pt-br|ru)){2,}(/.*)?$ /manual/$1$2

LanguagePriority en de es fr ja ko pt-br ru
ForceLanguagePriority Prefer Fallback
</Directory>


-----------------------------------------------------------------------------------------------------
usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-userdir.conf

# Settings for user home directories
#
# Required module: mod_userdir

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir public_html

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
-----------------------------------------------------------------------------------------------------
usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-autoindex.conf:
#
# Directives controlling the display of server-generated directory listings.
#
# Required modules: mod_autoindex, mod_alias
#
# To see the listing of a directory, the Options directive for the
# directory must include "Indexes", and the directory must not contain
# a file matching those listed in the DirectoryIndex directive.
#

#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
#
IndexOptions FancyIndexing HTMLTable VersionSort

# We include the /icons/ alias for FancyIndexed directory listings. If
# you do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/usr/share/apache2/icons/"

<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions. These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif

#
# AddDescription allows you to place a short description after a file in
# server-generated indexes. These are only displayed for FancyIndexed
# directories.
# Format: AddDescription "description" filename
#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz

#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName README.html
HeaderName HEADER.html

#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing. Shell-style wildcarding is permitted.
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t


[b][size=18][/size][color=red][/color]

paul[/b]
Linux (Ubuntu), ((XP))
Acer Travelmate 803LCI

pjjb
Lid geworden op: 19 mar 2006, 00:50
Locatie: 9100 Sint-Niklaas

10 jan 2010, 16:12

" BTW, als je wil experimenteren met nieuwe software edm, nooit op je production box werken. Ofwel via virtualbox ofwel op een andere machine.

Daar jij blijkbaar een LAMP servertje draait, moet je effe kijken naar Ubuntu Server 9.10."


virtualbox wil ik wel eens opzoeken, maar moet ik nog installeren en mijn gebruikerskennis zal dus ook nieuw zijn...

Ik houd me vooralsnog bij Ubuntu Desktop 8.10 (= LTS) en na een vroegere update van Ubuntu ben ik teveel data verloren om met nu weer eens in een nieuwe update te verliezen. Ik besef wel dat dit een dummie's reaktie is, maar voorlopig moet ik daar (nog) mee leven.
Idem dito voor Ubuntu Server..., daar begin ik (nog) niet aan.
Toch dank voor de VirtualBox suggestie, die ga ik zeker eens bekijken.
Tikiwiki opnieuw installeren is een volgende optie...
Linux (Ubuntu), ((XP))
Acer Travelmate 803LCI

hviaene
Lid geworden op: 05 apr 2004, 17:46
Locatie: Merksem

11 jan 2010, 08:58

pjjb schreef:Ik heb eens een reeks httpd.conf -bestanden bekeken, hier het resultaat:

/etc/apache2/httpd.conf:
ServerName localhost
-----------------------------------
usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-default.conf

#
# This configuration file reflects default settings for Apache HTTP Server.
#
# You may change these, but chances are that you may not need to.
#

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName Off

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of: Full | OS | Minor | Minimal | Major | Prod
# where Full conveys the most information, and Prod the least.
#
ServerTokens Full

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature On

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

--------------------------------------------------------------------------------
...knip ....

paul[/b]
Blijkbaar gebruikt Ubuntu een reeks files voor de Apache konfiguratie. Zie http://www.control-escape.com/web/confi ... ebian.html voor meer uitleg. Je zult in een van die files een DocumentRoot statement moeten vinden.