LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-02-2011, 11:25 PM   #1
aronaron
LQ Newbie
 
Registered: Feb 2011
Posts: 4

Rep: Reputation: 0
config apache server to list php, c/c++, java files as regular txt on website,


Hi all,
I'm new to linux and apache server,

I try to config my apache server to list all my files:
c/c++, php, java files, like the txt file on my server,

e.g
/var/www/mydomain/pub

i want to dump all my c/c++, php, java file under the pub directory and I can access it from my domain name,

if I dump txt file, I have no problem to view it, but when I dump c/c++ or php files under pub directory, then I can't view it like regular txt file,

Q: is there anyway I can configure my apache server to view all the c/C++, php, java file as like txt file?

It would be appreciated for any suggestions... or some example for the config file..

Thx
 
Old 02-03-2011, 01:49 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,218
Blog Entries: 1

Rep: Reputation: 2073Reputation: 2073Reputation: 2073Reputation: 2073Reputation: 2073Reputation: 2073Reputation: 2073Reputation: 2073Reputation: 2073Reputation: 2073Reputation: 2073
Hi,

You can use:
Code:
AddType text/plain php c cpp java
in httpd.conf.
Of course you can add any other file extension you want.

Regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Php files don't load in my Apache Server adrianc.grigoras Linux - Software 2 03-09-2009 11:38 AM
Please help with Apache Web Server / Apache Tomcat / PHP / Java / PHP-Java Bridge jpmad4it Linux - Server 2 01-05-2009 07:07 AM
Gentoo Linux - how to map Apache server to look at php files in multiple locations bg108 Linux - Newbie 3 02-07-2008 05:51 AM
PHP/Java/Anything that can split files, while files stay on Server? Lamborghini Kid Linux - Software 1 04-27-2007 05:53 PM
apache config files and php waynejkruse10 Linux - Software 8 12-05-2006 10:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration