LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-07-2017, 03:48 PM   #1
wl
LQ Newbie
 
Registered: Jan 2017
Posts: 22

Rep: Reputation: Disabled
Troubleshooting directory url for web application


I am running on Linux redhat Santiago and have nginx web application server installed.

we have one web application (http://servername.company.com) which uses packages that we downloaded under "/test/dir" directory.

we want to tell web application to go to that specific directory when application seeks any packages and do not go out on internet since site has blocked it for security reason.

if we want to provide (one config file) a value and ask application to go to specific directory, what would be the value?

I tried these value so far but not working,
"http://servername.company.com/test/dir"
"http://servername.company.com:<port#>/test/dir"

do we need to enable this path for directory from anywhere at OS level?


if someone can please help...
 
Old 04-07-2017, 07:51 PM   #2
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 744

Rep: Reputation: 323Reputation: 323Reputation: 323Reputation: 323
Edit: ooops, sorry! See #3: I didn't even recognize nginx! Thanks bathory!

It's UNDER /something/like/www
This web search may help: Apache root

For example, google.com wouldn't want the public to see /etc !

A link: https://www.centos.org/forums/viewtopic.php?t=31121
It says:Read /etc/httpd/conf/httpd.conf.
Then look in /var/www

You might be running a different httpd than apache.

For others who find this question here in future searches,
Please post some info about what/how you found and learned.
Thanks!

Last edited by !!!; 04-08-2017 at 02:59 AM.
 
1 members found this post helpful.
Old 04-08-2017, 02:37 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,840

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
@OP
Quote:
I tried these value so far but not working,
"http://servername.company.com/test/dir"
"http://servername.company.com:<port#>/test/dir"
Could you please define "not working"? I.e. provide logs or other relevant info.

Anyway, the default docroot for nginx on RHEL is /usr/share/nginx/html, so if you want to serve content from /test/dir, that is outside docroot, you need something like:
Code:
 location /test/dir {
 alias /test/dir;
 }
Please note that if you have SELinux enabled, you need to allow nginx access to /test/dir:
Code:
chcon -Rt httpd_sys_content_t /test/dir

@!!!
OP clearly states he's running nginx and not apache

Regards
 
2 members found this post helpful.
Old 04-12-2017, 02:11 PM   #4
wl
LQ Newbie
 
Registered: Jan 2017
Posts: 22

Original Poster
Rep: Reputation: Disabled
Actually our admin ran a some kind of python script/cmd and enabled it on 8000 port -> "http://servername.company.com:8000/test/dir" is accessible now. but when we try to access it from web application it gives error,

curl: (22) The requested URL returned error: 404 File not found
 
Old 04-12-2017, 03:06 PM   #5
wl
LQ Newbie
 
Registered: Jan 2017
Posts: 22

Original Poster
Rep: Reputation: Disabled
have python simple HTTP server as a web-server.
 
Old 04-13-2017, 01:30 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,235
Blog Entries: 10

Rep: Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160
Quote:
Originally Posted by woolawson123 View Post
Actually our admin
why can't your admin take care of the problem?
 
  


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
When Deploying web app directory tomcat application server got hanged ? findnerd2 Linux - Software 1 06-20-2015 04:07 PM
[SOLVED] troubleshooting load average on web server socalheel Linux - Server 9 03-03-2014 09:07 PM
How to Get URL Called By An Application Stannley Linux - Newbie 2 09-19-2013 09:15 PM
How to secure a directory in the web application? vishnukumar Red Hat 2 08-27-2009 08:25 PM
Web application: cocoon jsp/servlet tomcat all in web application adilturbo Programming 0 11-24-2007 06:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:19 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