Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8315595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:10:03+00:00 2026-06-08T21:10:03+00:00

One of my website pages (written in PHP) manipulates a MySQL database before starting

  • 0

One of my website pages (written in PHP) manipulates a MySQL database before starting a .jar archive in background, with the following command :

nohup java -jar myJar.jar > /dev/null &

This jar creates a text file in a folder (the current one or subfolders). For my Java program to write file, I have to set the w (write) permission to a (all users) on the www folder (or one of its subfolders).

Based on what I read, one of the solutions would be to give the write permission only to www-data, which would be Apache. Howerver I cannot see how it is more secure than a 777 chmod, because a hacker would always have the permission to write through his browser.

Do you know a solution which would :

  • Make my server as safe as possible.
  • Allow my Java program (launched by PHP) to create and modify files on the server.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:10:04+00:00Added an answer on June 8, 2026 at 9:10 pm

    run your java program as a deamon with its own user with a privelege to edit that specific folder.

    Set it to monitor a file or database to see if it needs to run and do its thing. Then when your php script needs it just modify the file/database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a php code which will get one id from database and
I migrated a cake website from one server to another, but in statics pages
my website consists only of one page where all other pages are loaded in
I have one master page which applies to all pages in this website. On
All, I have a PHP website written in Zend Framework and MVC. Most of
I'm trying to log onto the following website using HttpWebRequest: http://mostanmeldung.moessinger.at/login.php Texts are in
One of my friends has written a website that has so many user controls
I have a website that has an index.php, a few simple .html pages and
So I'm teaching myself Ruby on Rails, with a PHP background. I've written a
I've recently taken over development of a website written in asp.net. Before taking this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.