Problem with LAMP permissions [SOLVED]

Alright it seems this happens every time I install LAMP server in one form or another.
I cant seem to be able to edit the /srv/http folder content with my usual user account.
I really don't want editing stuff as sudo all the time so I really want to be able to edit
the contents of that folder as a normal user.
Here's what puzzles me.  As far as I can tell I have done everything necessary to give
a normal user write rights to the folder.  Command groups give the following:
lp wheel http games network video audio optical storage power users
And when looking at folder permissions I got this:
drwxr-sr-x 5 root root .
drwxr-sr-x 18 root root ..
drwxr-sr-x 2 http http ftp
drwxr-sr-x 2 http http http
drwxr-sr-x 2 http http vhosts
In apache.conf user and group are set to http.
So where's the problem?
Last edited by Gri3T0m (2013-12-22 15:56:31)

Those permissions say the "http" user can read / write but people in the "http" group can only read. Is that what you wanted? It sounds to me like you intended to set the permissions to "775" instead of "755".
NOTE: I'm kind of distracted right now. I may be misunderstanding your question or that "s" in your permissions...
Last edited by drcouzelis (2013-12-22 15:26:09)

Similar Messages

  • Problem with file permissions

    Hello all,
    I am making a simple HttpServlet, which takes input
    from html page and saves in to a file, but I'm having a
    bit of a problem with file permissions.
    I'm getting the following exception
    java.security.AccessControlException: access denied (java.io.FilePermission ./data/result read)
         java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         java.security.AccessController.checkPermission(AccessController.java:427)
         java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         java.lang.SecurityManager.checkRead(SecurityManager.java:871)
         java.io.File.exists(File.java:700)
         SyksyHTTPServlet.doPost(SyksyHTTPServlet.java:31)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)The exception seems to occur when I'm trying to check whether the file already
    exists or not.
    The data directory has all permissions (read, write and execute) set for all users,
    and I have made an empty file called result inside the data directory for testing.
    This file has read and write permissions enabled for all users.
    Here's my code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.Enumeration;
    import java.util.List;
    import java.util.ArrayList;
    public class SyksyHTTPServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              int totalCount = 0;
              List list;
              String song = request.getParameter("song");
              PrintWriter out = response.getWriter();
              File file = new File("./data/result");
              if(file.exists())  // this is line 31, which seems to cause the exception
                   list = readFile(file);
              else
                   file.createNewFile();
                   list = new ArrayList();
              list.add(song);
              writeFile(file, list);
              for(int i = 0 ; i < list.size() ; i++)
                   out.println(list.get(i));
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
         private List readFile(File file)
              List list = null;
              try
                   FileInputStream fis = new FileInputStream(file);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   list = (ArrayList)ois.readObject();
                   ois.close();
              catch(Exception e)
                   e.printStackTrace();
              return list;
         private void writeFile(File file, List list)
              try
                   FileOutputStream fos = new FileOutputStream(file);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                   oos.writeObject(list);
                   oos.flush();
                   oos.close();
              catch(Exception e)
                   e.printStackTrace();
    }I'm using Tomcat 5.5 on Ubuntu Linux, if that has anything to do with this.
    I'll appreciate all help.
    kari-matti

    Hello again.
    I'm still having problems with this. I made
    a simple servlet that reads from and writes
    to text file. The reading part work fine on my
    computer, but the writing doesn't, not even
    an exception is thrown if the file exists that
    I'm trying to write to. If I try to create a new
    file I'll get an exception about file permissions.
    I also asked a friend of mine to try this same
    servlet on his windows computer and it works
    as it should.
    Here's the code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class ReadServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              String s = "";
              PrintWriter out = response.getWriter();
              String docroot = getServletContext().getRealPath( "/" );
              out.println("docroot: "+docroot);
              File file = new File(docroot+"test.txt");
              if(file.exists())
                   s = readFile(file);
                   out.println(s);
              else
                   out.println("file not found");
                   //file.createNewFile();                    // causes exception
                   //out.println("new file created.");
              writeFile(file, "written by servlet");
              out.println("Now look in the file "+file.getPath());
              out.println("and see if it contains text 'written by servlet'");
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
         private String readFile(File file)
              FileInputStream fis = null;
              BufferedInputStream bis = null;
              DataInputStream dis = null;
              String s = "";
              try
                   fis = new FileInputStream(file);
                   bis = new BufferedInputStream(fis);
                   dis = new DataInputStream(bis);
                   s = dis.readLine();
                   fis.close();
                   bis.close();
                   dis.close();
              catch(Exception e)
                   e.printStackTrace();
              return s;
         private void writeFile(File file, String s)
              FileOutputStream fos = null;
              BufferedOutputStream bos = null;
              DataOutputStream dos = null;
              try
                   fos = new FileOutputStream(file);
                   bos = new BufferedOutputStream(fos);
                   dos = new DataOutputStream(bos);
                   dos.writeChars(s);
                   fos.flush();
                   bos.flush();
                   dos.flush();
                   fos.close();
                   bos.close();
                   dos.close();
              catch(Exception e)
                   e.printStackTrace();
    }And if someone wants to test this servlet I can
    give a war package.
    Any advices?
    kari-matti

  • [solved] findutils - problem with file permissions

    Hey,
    I tried running makepkg -c for an updated PKGBUILD of a package I maintain in the AUR (gretl), and it seemed fine but then hit:
    ==> Tidying install...
    -> Purging other files...
    -> Compressing man and info pages...
    -> Stripping debugging symbols from binaries and libraries...
    -> Removing libtool .la files...
    -> Removing empty directories...
    find: invalid predicate `-delete'
    I'd had some other strange errors with find over the past few weeks or so (my last -Syu was after this month's catalyst driver came out with support for the current kernel) but had shrugged them off. This error made me decide to try reinstalling findutils, and it gave the error:
    error: cannot remove file 'usr/bin/find': Operation not permitted
    a bit stupidly, I tried pacman -Rd then -S findutils, and now I get
    error: failed to commit transaction (conflicting files)
    findutils: /usr/bin/find exists in filesystem
    Errors occurred, no packages were upgraded.
    missing dependency for ca-certificates : findutils
    missing dependency for initscripts : findutils
    missing dependency for mkinitcpio : findutils
    missing dependency for texinfo : findutils
    ls -als /usr/bin | grep find     gives:
    12 -rwxr-xr-x 1 root root 10636 Mar 25 16:24 deepfind
    64 -rwxr-xr-x 1 root root 59200 May 9 01:58 efinder
    64 -rwxr-xr-x 1 500 500 59536 Jun 16 14:49 find
    and rm, mv, chmod, chown etc on /usr/bin/find as root, and from livecd, all also come back with "Operation not permitted".
    find seems to work fine for a few simple uses I've just tried.. but the last time I ran makepkg -c without the error was before the last system upgrade, so I'm guessing find didn't upgrade properly then due to whatever is wrong with the permissions, leading to the other errors.
    Anyway, I guess the question is, can I do anything to get rid of /usr/bin/find and reinstall findutils? don't mind so much about missing dependencies as I tend not to upgrade that often, but find not doing what it should is a bit of a pain.
    Last edited by manehi (2009-08-30 08:52:20)

    mm I tried all that, and no luck. though trying adduser 500 did give me a helpful reminder that usernames can't start with numbers...
    anyway, it's not a huge deal atm, and I can always clean reinstall the / partition if things really break. Thanks all the same.
    PS:
    huh, just had a thought - I remember how I used to get annoyed how mounting partitions using ext2ifs in windows didn't respect permissions properly. and now I almost wish I had a windows partition / that this wasn't a laptop hard drive...
    Last edited by manehi (2009-08-30 00:31:13)

  • Live Data / Problem with file permissions

    Just trying out an old version of Dreamweaver MX 2004. I am
    using my webhosting service for remote server/testing server
    duties. It is running PHP 4.3.10 and MySQL 3.23.58. I was able to
    set up the database connection and test-retrieve a recordset with
    no problems. In following the tutorial I found that Livedata
    wouldn't work, it just giving me a warning about file permissions
    being wrong. It turns out that when Dreamweaver creates a temporary
    file of the work-in-progress to upload to the remote server the
    file is created on the server with owner=rw, group=rw, world=r
    which explains why it won't run - group has to be set to group=r.
    The file is created on the fly and then immediately deleted by
    Dreamweaver so it is impossible to manually set the permission on
    the server and probably fairly pointless too.
    I tried just saving the file and previewing in the browser
    which again causes it to be uploaded to the remote server. The
    first time this resulted in the browser offering a file download
    box instead of running the page. The reason is - again - that
    Dreamweaver is setting the uploaded file permissions to include
    group=rw. If I manually set the permission for group to group=r it
    runs fine.
    It turns out that Dreamweaver is always setting the file
    permissions on file uploads (checked php and html) to the
    remote/testing server to include group=rw. Once I set it manually
    on the remote/testing server to group=r for a php file everything
    is fine and subsequent uploads of the same file do not change it
    again.
    I checked with the webhosting company and their second-line
    have reported back to me that the default file permission they set
    on uploaded files includes group=r so it must be DW that is causing
    the problem by setting group=rw the first time. I confirmed this by
    using WS-FTP to upload the same file (renamed) to the same target
    directory and the permissions set were owner=rw, group=r, world=r.
    So
    Can anyone please tell me how to change the permissions DW
    sets on files written to a remote server because I have spent
    countless hours on it without success. From looking at other posts
    in this forum it could be that other users are hitting the same
    kind of problem with DW8

    Stop using Live Data with a hosting account. Set up PHP and
    MySQL locally on
    your machine. That is how it's supposed to work. You
    shouldn't test files on
    the fly on a host as you write them. Change your test account
    in DW to use
    the local server. Upload your files to your remote server
    after they are
    fully tested.
    Tom Muck
    http://www.tom-muck.com/
    "nigelssuk" <[email protected]> wrote in
    message
    news:[email protected]...
    > Just trying out an old version of Dreamweaver MX 2004. I
    am using my
    > webhosting
    > service for remote server/testing server duties. It is
    running PHP 4.3.10
    > and
    > MySQL 3.23.58. I was able to set up the database
    connection and
    > test-retrieve a
    > recordset with no problems. In following the tutorial I
    found that
    > Livedata
    > wouldn't work, it just giving me a warning about file
    permissions being
    > wrong.
    > It turns out that when Dreamweaver creates a temporary
    file of the
    > work-in-progress to upload to the remote server the file
    is created on the
    > server with owner=rw, group=rw, world=r which explains
    why it won't run -
    > group
    > has to be set to group=r. The file is created on the fly
    and then
    > immediately
    > deleted by Dreamweaver so it is impossible to manually
    set the permission
    > on
    > the server and probably fairly pointless too.
    >
    > I tried just saving the file and previewing in the
    browser which again
    > causes
    > it to be uploaded to the remote server. The first time
    this resulted in
    > the
    > browser offering a file download box instead of running
    the page. The
    > reason is
    > - again - that Dreamweaver is setting the uploaded file
    permissions to
    > include
    > group=rw. If I manually set the permission for group to
    group=r it runs
    > fine.
    >
    > It turns out that Dreamweaver is always setting the file
    permissions on
    > file
    > uploads (checked php and html) to the remote/testing
    server to include
    > group=rw. Once I set it manually on the remote/testing
    server to group=r
    > for a
    > php file everything is fine and subsequent uploads of
    the same file do not
    > change it again.
    >
    > I checked with the webhosting company and their
    second-line have reported
    > back
    > to me that the default file permission they set on
    uploaded files includes
    > group=r so it must be DW that is causing the problem by
    setting group=rw
    > the
    > first time. I confirmed this by using WS-FTP to upload
    the same file
    > (renamed)
    > to the same target directory and the permissions set
    were owner=rw,
    > group=r,
    > world=r.
    >
    > So
    >
    > Can anyone please tell me how to change the permissions
    DW sets on files
    > written to a remote server because I have spent
    countless hours on it
    > without
    > success. From looking at other posts in this forum it
    could be that other
    > users
    > are hitting the same kind of problem with DW8
    >

  • Problem with file permissions using Snow Lepord

    I'm having problems with file Sharing & Permissions using Snow Lepord.
    When I save any new file it only has 'Read & Write' privileges for the user, everyone else is 'read only' or 'no access'.
    We have a Netgear NAS Server which is accessed by other users over the local network and if I change the Privilege to 'read & write' via Get Info and then copy the file from my desktop to ther server it changes the Privilege of the server version to 'no access' we then have to change it again for it to work.
    I also created a new folder on the server and now it says 'no access' and has a no entry icon!
    Any ideas???

    We have issues like this. Have tried running AFP and SMB, now connecting using CIFS. All have the same problem. I can work on one or two files fine, then suddenly, one of the files I just worked on says I don't have permissions. I log off the server and log back on, and then I have permissions to the file. It will work fine for one or two operations, then fails. We just updated to OSX Mavericks and a Windows 2012 server, but have been having this issue for years. My permissions look fine. I can even change permissions, but it won't let me work on the file or move or delete the file or rename the file. Once I log out and log back in, I can do anything I want.

  • Two problems with iTunes (permissions issue?)

    Hello,
    I have two problems with iTunes. I am not sure if they are related that's why I post them both.
    1) iTunes doesn't delete apps after updating them anymore. This is happening since the (two?) last versions of iTunes and is the same with 10.5. The reason seems to be the permissions of the apps. Nearly all have "everyone = custom". Therefore I have to enter my admin password when I try to delete them manually. And iTunes itself cannot delete them on its own, of course. Why is this happening? Why is iTunes assigning such permissions to downloaded apps?
    2) I can't login to my account from within iTunes anymore. That is also happening since quite a while. I am logged in (my ID is shown in the top right of the store) but cannot access my account details. iTunes asks for my password but after entering it the login mask appears again. It's not the password itself, it is correct.
    Any suggestions?

    Correct answer to find here:
    https://discussions.apple.com/thread/1215039?start=0&tstart=0

  • Having Problems With Sharing & Permissions in Finder

    I am using a Mac Mini (mid-2011) running Lion Server 10.7.4.
    I have noticed lately that when I check files the Sharing & Permissions portion using Get Info on my files I find that there are two lines for each user on my compuer.  The first set of lines says Read & Write which I actually selected.  The second set of lines says Custom.  When I check I have the list Read & Write, Read, Custom.  When I try to change Custom I cam select new option No Privileges Info.  For the other users I am able to delete the extra line once I select No Privileges Info.  However even though I have more than one line I cannot delete the extra line for the main user.  I will try and delete the extra line for the main user logged in as someone else that has what I have defined as admin privileges (reason I have more than one user).
    This really concerns me because this issue is causing problems with me adding or removing files as needed in the terminal.  When I try I get this funky error:
    Dubious permissions on file (skipping): filename with duplicate entries for a user.
    This is happening more and more even though I am not changing the file permissions that I am aware of.
    Any help would be appreciated.

    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Back up all data now. Before proceeding, you must be sure you can restore your system to its present state
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the page that opens.
    Drag or copy — do not type — the following line into the Terminal window, then press return:
    chmod -R -N ~
    The command will take a noticeable amount of time to run. When a new line ending in a dollar sign ($) appears below what you entered, it’s done. You may see a few error messages about an “invalid argument” while the command is running. You can ignore those. If you get an error message with the words “Permission denied,” enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the Recovery screen appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens. You’re not going to reset the password.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Problems with update / permissions

    Hi
    I have a problem with my 15" mid 2010 macbook Pro with 8GB RAM, running Lion with 10.7.4.
    Problem:
    I cannot update the SW running the Apple update - I finds the new updates for iMovie, iPhoto, Java etc, but when asking it to install them, it prompts me that I cannot install due to not having the correct permissions.
    The problem occured approx 3-4 weeks ago. Before that I had never experienced this before...
    I have repaired the permissions, but that didn't help - does anyone have a solution to this?
    FYI I'm still a novice on the Mac - so I'm learning everyday....
    Br
    Per

    Besides repairing permissions with disk utility, you need to reset your user permissions. Follow instructions here:
    Repairing User Permissions in OS X Lion
    You’ll need to reboot to perform this, and then use the same resetpassword utility that is used to change passwords in Lion, but instead choosing a hidden option.
    When you use the Disk Utility app and Repair Permissions — it doesn’t actually repair the permission settings on folders and files in your Home folder where your documents and personal applications reside.
    In Lion, there is an additional Repair Permissions application utility hidden away. This toolis located inside boot Repair Utilities. Here’s how to access it.
    Restart Lion and hold down the Command and R keys.
    You will boot into the Repair Utilities screen. On top, in the Menu Bar click the Utilities item then select Terminal.
    In the Terminal window, type resetpassword and hit Return.
    The Password reset utility launches, but you’re not going to reset the password. Instead, click on the icon for your Mac’s hard drive at the top. From the drop-down below it, select the user account where you are having issues.
    At the bottom of the window, you’ll see an area labeled ‘Reset Home Directory Permissions and ACLs’. Click the Reset button there.
    The reset process takes a couple of minutes. When it’s done, quit the programs you’ve opened and restart your Mac. Notice that ‘Spotlight’ starts re-indexing immediately.

  • Problems with Calendar Permissions

    Hi There. I am having a problem with the Calendar of one user:
    This user cannot share his calendar from OWA or Outlook, nor can I set then in Powershell. Even worse, I can't even view his calendar permissions in PowerShell. For all other folders there's no problem.
    So for example, I can run:
    get-mailboxfolderstatistics -identity user | select-object name
    this proves to me there's a path of username:\calendar and it does exist. Then I can run:
    get-mailboxfolderpermission username:\inbox
    and this is fine. But if I run:
    get-mailboxfolderpermission username:\calendar
    I get this error:
    "The operation couldn't be performed because object 'username:\calendar' couldn't be found on 'Microsoft.Exchange.Data.Storage.MailboxSession'"
    I have to stress this is a medium sized deployment with 6 databases and 4000+ mailboxes. This is the ONLY mailbox (and specifically the only folder) to be displaying this behaviour.
    Has anyone ever seen similar behaviour for a single folder for a single user before?

    Hi,
    Please right-click the Calendar folder for this mailbox in Outlook Online mode, and check the Permissions tab in the Properties. We need to check whether the name Default is listed there with permissions.
    If the Default is missing in the permission list, please refer to Will’s suggestion to recreate the calendar folder with MFCMapi. If the permission list is normal for this mailbox, please move the problematic mailbox to another database to have a try.
    Personal suggestion, please try the following command:
    Get-MailboxFolderPermission -Identity Username:\Kalender
    | FL
    Regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Winnie Liang
    TechNet Community Support

  • Problem with socket permissions!

    Hi All!
    I'm developing an applet that displays an image after downlading it from a server; this server is different from the server I download the applet from, so I have problems with security. In fact I get the following exception:
    java.security.AccessControlException: access denied (java.net.SocketPermission 172.16.1.22:8080 connect,resolve)
    I'm using:
    - Java Plugin 1.3;
    - Netscape 7.0;
    - IE 6;
    I've tried to self-sign the applet but with no results (maybe I cannot use selfsigned certificate with java plugin 1.3);
    After that I've created a new policy file ("MyPolicy" file)and mentioned it into:
    C:\Program Files\JavaSoft\JRE\1.3.1_03\lib\security\java.policy
    but it didn't resolve my problem (maybe I'm doing something wrong in creating my policy file??!!).
    Which steps do I have to follow in order to make my applet connect to images server without security problems?
    Thanks so much in advance,
    Carlo

    1.     Compile the applet
    2.     Create a JAR file
    3.     Generate Keys
    4.     Sign the JAR file
    5.     Export the Public Key Certificate
    6.     Import the Certificate as a Trusted Certificate
    7.     Create the policy file
    8.     Run the applet
    Susan
    Susan bundles the applet executable in a JAR file, signs the JAR file, and exports the public key certificate.
    1.     Compile the Applet
    In her working directory, Susan uses the javac command to compile the SignedAppletDemo.java class. The output from the javac command is the SignedAppletDemo.class.
    javac SignedAppletDemo.java
    2.     Make a JAR File
    Susan then makes the compiled SignedAppletDemo.class file into a JAR file. The -cvf option to the jar command creates a new archive (c), using verbose mode (v), and specifies the archive file name (f). The archive file name is SignedApplet.jar.
    jar cvf SignedApplet.jar SignedAppletDemo.class
    3.     Generate Keys
    Susan creates a keystore database named susanstore that has an entry for a newly generated public and private key pair with the public key in a certificate. A JAR file is signed with the private key of the creator of the JAR file and the signature is verified by the recipient of the JAR file with the public key in the pair. The certificate is a statement from the owner of the private key that the public key in the pair has a particular value so the person using the public key can be assured the public key is authentic. Public and private keys must already exist in the keystore database before jarsigner can be used to sign or verify the signature on a JAR file.
    In her working directory, Susan creates a keystore database and generates the keys:
    keytool -genkey -alias signFiles -keystore susanstore -keypass kpi135 -dname "cn=jones" -storepass ab987c
    This keytool -genkey command invocation generates a key pair that is identified by the alias signFiles. Subsequent keytool command invocations use this alias and the key password (-keypass kpi135) to access the private key in the generated pair.
    The generated key pair is stored in a keystore database called susanstore (-keystore susanstore) in the current directory, and accessed with the susanstore password (-storepass ab987c).
    The -dname "cn=jones" option specifies an X.500 Distinguished Name with a commonName (cn) value. X.500 Distinguished Names identify entities for X.509 certificates.
    You can view all keytool options and parameters by typing:
    keytool -help
    4.     Sign the JAR File
    JAR Signer is a command line tool for signing and verifying the signature on JAR files. In her working directory, Susan uses jarsigner to make a signed copy of the SignedApplet.jar file.
    jarsigner -keystore susanstore -storepass ab987c -keypass kpi135 -signedjar SSignedApplet.jar SignedApplet.jar signFiles
    The -storepass ab987c and -keystore susanstore options specify the keystore database and password where the private key for signing the JAR file is stored. The -keypass kpi135 option is the password to the private key, SSignedApplet.jar is the name of the signed JAR file, and signFiles is the alias to the private key. jarsigner extracts the certificate from the keystore whose entry is signFiles and attaches it to the generated signature of the signed JAR file.
    5.     Export the Public Key Certificate
    The public key certificate is sent with the JAR file to the whoever is going to use the applet. That person uses the certificate to authenticate the signature on the JAR file. To send a certificate, you have to first export it.
    The -storepass ab987c and -keystore susanstore options specify the keystore database and password where the private key for signing the JAR file is stored. The -keypass kpi135 option is the password to the private key, SSignedApplet.jar is the name of the signed JAR file, and signFiles is the alias to the private key. jarsigner extracts the certificate from the keystore whose entry is signFiles and attaches it to the generated signature of the signed JAR file.
    5: Export the Public Key Certificate
    The public key certificate is sent with the JAR file to the whoever is going to use the applet. That person uses the certificate to authenticate the signature on the JAR file. To send a certificate, you have to first export it.
    In her working directory, Susan uses keytool to copy the certificate from susanstore to a file named SusanJones.cer as follows:
    keytool -export -keystore susanstore -storepass ab987c -alias signFiles -file SusanJones.cer
    Ray
    Ray receives the JAR file from Susan, imports the certificate, creates a policy file granting the applet access, and runs the applet.
    6.     Import Certificate as a Trusted Certificate
    Ray has received SSignedApplet.jar and SusanJones.cer from Susan. He puts them in his home directory. Ray must now create a keystore database (raystore) and import the certificate into it. Ray uses keytool in his home directory /home/ray to import the certificate:
    keytool -import -alias susan -file SusanJones.cer -keystore raystore -storepass abcdefgh
    7.     Create the Policy File
    The policy file grants the SSignedApplet.jar file signed by the alias susan permission to create newfile (and no other file) in the user's home directory.
    Ray creates the policy file in his home directory using either policytool or an ASCII editor.
    keystore "/home/ray/raystore";
    // A sample policy file that lets a JavaTM program
    // create newfile in user's home directory
    // Satya N Dodda
    grant SignedBy "susan"
         permission java.security.AllPermission;
    8.     Run the Applet in Applet Viewer
    Applet Viewer connects to the HTML documents and resources specified in the call to appletviewer, and displays the applet in its own window. To run the example, Ray copies the signed JAR file and HTML file to /home/aURL/public_html and invokes Applet viewer from his home directory as follows:
    Html code :
    </body>
    </html>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="600" height="400" align="middle"
    codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,1,2">
    <PARAM NAME="code" VALUE="SignedAppletDemo.class">
    <PARAM NAME="archive" VALUE="SSignedApplet.jar">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    </OBJECT>
    </body>
    </html>
    appletviewer -J-Djava.security.policy=Write.jp
    http://aURL.com/SignedApplet.html
    Note: Type everything on one line and put a space after Write.jp
    The -J-Djava.security.policy=Write.jp option tells Applet Viewer to run the applet referenced in the SignedApplet.html file with the Write.jp policy file.
    Note: The Policy file can be stored on a server and specified in the appletviewer invocation as a URL.
    9.     Run the Applet in Browser
    Download JRE 1.3 from Javasoft

  • Problems with folder.getList(); (Solved)

    EDITED, solution in the end
    Hello, I'm getting my Imap account folder list and I'm haveing problems with that. I have read the Javamail API demo example (folderlist.java), but I'm having problems when I use differents servers.
    The problem is that with my server I don't know why in my console I'm printing the folder list two times, one with "" "*" and another with INBOX.*:
    I only want the first one.
    ++
    +A2 LIST "" "*"+
    +* LIST (\Unmarked \HasChildren) "." "INBOX"+
    +* LIST (\HasNoChildren) "." "INBOX.Carpeta1.Carpeta11"+
    +* LIST (\HasNoChildren) "." "INBOX.Be&APE-at.A"+
    +* LIST (\HasChildren) "." "INBOX.Carpeta1"+
    +* LIST (\HasChildren) "." "INBOX.Be&APE-at"+
    +* LIST (\HasNoChildren) "." "INBOX.Trash"+
    +A2 OK LIST completed+
    +A3 LIST "" "INBOX.*"+
    +* LIST (\HasNoChildren) "." "INBOX.Carpeta1.Carpeta11"+
    +* LIST (\HasNoChildren) "." "INBOX.Be&APE-at.A"+
    +* LIST (\HasChildren) "." "INBOX.Carpeta1"+
    +* LIST (\HasChildren) "." "INBOX.Be&APE-at"+
    +* LIST (\HasNoChildren) "." "INBOX.Trash"+
    +A3 OK LIST completed+
    ++
    The only thing that I want is, get the folder list and add to my ArrayList, nothing more. I think that should be very easy, but I don't know what are I doing wrong.
    I'm doing
    ++
    +folder = store.getFolder("*");//to take the folder+
    +Folder[] listaCarpetas = folder.list("*"); //to take the list+
    ++
    I can do all in one sentence? Or which is the solution to do that to all type of servers (my own server, gmail, ....). Some days ago I did something that works(not totaly right but..) but now I have "lost" that code. I hope that someone can help me to get the list.
    Thanks!
    I edited because I have the solution. The solution is:
    folder = store.getDefaultFolder();
    Folder[] listaCarpetas = folder.list("*");Edited by: baltuna on 16-oct-2009 9:42
    Edited by: baltuna on 16-oct-2009 9:55

    hi Leann!
    QuickTime failed to initialize (error -2093). QuickTime is required to run iTunes. Please reinstall iTunes.
    let's use an augmented version of the following procedure:
    http://docs.info.apple.com/article.html?artnum=31115
    the augmentation is that keep all antivirus and antispyware applications switched off during installs and uninstalls.
    if you're still running into trouble, try switching off
    b all
    applications running in the background. there's instructions given here:
    http://consumer.installshield.com/kb.asp?id=Q108377
    keep us posted.
    love, b

  • Problems with 6.0 Solved!!

    I was having problems with downloading itunes 6.0, apparently you need the newest version of quicktime to download 6.0. Use the link to download to quicktime first, then update to 6.0 and it should work just fine!!
    http://www.apple.com/quicktime/download/standalone.html

    hi Leann!
    QuickTime failed to initialize (error -2093). QuickTime is required to run iTunes. Please reinstall iTunes.
    let's use an augmented version of the following procedure:
    http://docs.info.apple.com/article.html?artnum=31115
    the augmentation is that keep all antivirus and antispyware applications switched off during installs and uninstalls.
    if you're still running into trouble, try switching off
    b all
    applications running in the background. there's instructions given here:
    http://consumer.installshield.com/kb.asp?id=Q108377
    keep us posted.
    love, b

  • Problem with all docks (SOLVED)

    Hi there
    i have a problem with docky and AWN
    first of all I can not run the dicky and get this error
    [eman@eMan-PC ~]$ docky
    [Info 14:21:38.484] Docky version: 2.1.3 Release
    [Info 14:21:38.507] Kernel version: 2.6.39.0
    [Info 14:21:38.508] CLR version: 2.0.50727.1433
    Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Docky.Services.DockServices ---> System.TypeLoadException: A type load exception has occurred.
    at Docky.Services.SystemService..ctor () [0x00000] in <filename unknown>:0
    at Docky.Services.DockServices..cctor () [0x00000] in <filename unknown>:0
    --- End of inner exception stack trace ---
    at Docky.UserArgs.Parse (System.String[] args) [0x00000] in <filename unknown>:0
    at Docky.Docky.Main (System.String[] args) [0x00000] in <filename unknown>:0
    [eman@eMan-PC ~]$
    I can run the AWN but can't go to preferences and get this error
    ** (awn-applet:17489): CRITICAL **: file default/libdesktop-agnostic/desktop-entry-impl-gio.c: line 695: uncaught error: Invalid key name: Path[$e] (g-key-file-error-quark, 1)
    ** Message: pygobject_register_sinkfunc is deprecated (AwnOverlay)
    /home/eman/.gtkrc-2.0:3: error: unexpected character `\342', expected string constant
    /usr/bin/awn-settings:1064: GtkWarning: Failed to get constuct only property adjustment of monitor_align_hscale with value `adjustment1'
    self.wTree.add_from_file(self.XML_PATH)
    Traceback (most recent call last):
    File "/usr/bin/awn-settings", line 1223, in <module>
    awnmanager = awnManagerMini()
    File "/usr/bin/awn-settings", line 1072, in _init_
    self.createMainMenu()
    File "/usr/bin/awn-settings", line 1137, in createMainMenu
    self.safe_load_icon('gtk-execute', size, gtk.ICON_LOOKUP_USE_BUILTIN),
    File "/usr/share/avant-window-navigator/awn-settings/awnClass.py", line 1044, in safe_load_icon
    icon = self.theme.load_icon('gtk-missing-image', size, flags)
    glib.GError: Icon 'gtk-missing-image' not present in theme
    any one could help me please?
    Forgive my poor English
    Last edited by eMan (2011-07-31 11:19:07)

    Thanks for respond
    it drives me crazy
    this is my .gtkrc-2.0
    GNU nano 2.2.6 File: .gtkrc-2.0
    include "/usr/share/themes/kde44-oxygen-molecule/gtk-2.0/gtkrc"
    style “Sans Serif 9″
    widget_class “*” style “Sans Serif 9″
    gtk-theme-name=”kde44-oxygen-molecule”
    gtk-font-name=”DejaVu Sans 12″
    I am a real newbie
    please help me in simple way

  • [Solved] Problem with file permissions for a group

    I'm working on a simple Apache HTTP server just to get a small education in proper unix work.
    To save myself sudoing everything (and generally because it seems the proper way to use unix), I'm trying to give my user control over the /srv directory. So I ran:
    - `sudo groupadd srvadmin` to create a group called srvadmin
    - `sudo chown -R :srvadmin /srv` to change the group-owner of /srv to srvadmin (and all files inside it)
    - `sudo chmod -vR g+w /srv` to give /srv and all its files group write permission
    - `sudo gpasswd -a <me> srvadmin` to add my user to the srvadmin group
    But I still can't create or edit files in /srv
    "ls -l / | grep srv" gives:
    drwxrwxr-x 4 root srvadmin 4096 Dec 19 17:44 srv
    all the files and directories inside /srv also have group write permissions and are owned by user "root" and group "srvadmin"
    "cat /etc/group | grep srv" gives:
    srvadmin:x:1000:<me>
    However, possibly herein lies a clue:
    "id" gives:
    uid=1000(<me>) gid=100(users) groups=100(users),7(lp),10(wheel),50(games),91(video),92(audio),93(optical),95(storage),96(scanner),98(power)
    That is, "id" doesn't tell me I'm in the srvadmin group.
    It seems like there's an important concept about groups and permissions that I'm not getting, but reading several man and wiki pages hasn't enlightened me. Could anyone suggest what I'm missing?
    Thanks.
    Last edited by bjackman (2012-01-15 20:43:09)

    fsckd wrote:
    bjackman wrote:Edit: I'm guessing only mods can put [Solved] tags in a title?
    No, our job is to tell you to do it yourself: https://wiki.archlinux.org/index.php/Fo … ow_to_Post (second to last bullet)
    Ok, this is pretty embarrassing given the parallels with the topic of this thread, but I coudn't edit the title (which is the reason for my earlier remark; I assumed I didn't have permission)!
    The text box was un-editable (not "disabled", I just couldn't edit the text in it). I managed to change it in the end by deleting all the text and typing a new title. I think it may have been just because the title was at the exact character limit.

  • [SOLVED] Problem with UNIX permissions

    Hello everyone.
    It seems I don't have the permission to write in a folder but I don't understand why :
    olivier:~$ ls -l /srv/
    total 8
    dr-xr-xr-x 2 root ftp 4096 Feb 14 10:16 ftp
    drwxrwxr-x 2 http http 4096 Feb 22 16:53 http
    olivier:~$ cat /etc/group | grep http
    http::33:olivier
    olivier:~$ cd /srv/http
    olivier:/srv/http$ touch myfile
    touch: cannot touch `myfile': Permission denied
    So /srv/http is owned by user http of group http, with write permission for group members.
    I am part of the http group but I can't create (or delete) a file in /srv/http.
    Is this behaviour normal?
    Thanks!
    Last edited by pokraka (2010-02-23 00:55:32)

    ewaller wrote:Have you logged out and back in since becoming a member of group http?
    I guess that was the problem since now after rebooting it works!
    Thanks.
    Last edited by pokraka (2010-02-23 00:56:02)

Maybe you are looking for