Shared MikTex install on windows server 2012 to generate PDF from IIS
up vote
0
down vote
favorite
I'm trying to install a shared MikTex on a Windows server 2012, so my web application (Perl CGI / IIS 8) can generate PDF files on the fly through pdflatex, and send them to the user.
I managed to install MikTex 2.9.6637 (x64) on the server through full download on another machine and transferring the files (the server has no web access), and it does work from the command line.
However I have trouble when I try to run my command from a Perl / CGI script from the webserver, when I configure IIS to use anonymous authentication through the windows account Network Service: access denied.
When I use IIS windows authentication, and the script runs with my own windows account (admin), it runs fine. Definitely an access management problem.
I used the options found on this page
http://docs.miktex.org/2.9/manual/setupwiz.html
in order to configure all folders in a simple D:miktex_local on which i can grant all privileges to this network service, instead of the default / folders.
The only folder I did not manage to configure myself is the log directory that stays in:
C:ProgramDataMiKTeX2.9miktexlog
But I granted privileges on this one, and it does not seem to be used even when I manage to generate the pdf.
My test script can write in these folders and logs are generated.
I also test from the script that the user has r/w privileges on my in and out folders.
This is the log from a success run (admin user):
2018-03-29 14:14:48,797+0200 INFO pdflatex - starting with command line: D:miktexmiktexbinx64pdflatex -output-directory=D:testout D:testintoken.tex
2018-03-29 14:14:48,797+0200 WARN pdflatex - running with administrator privileges
2018-03-29 14:14:48,813+0200 INFO pdflatex - allowing known shell commands
2018-03-29 14:14:48,813+0200 INFO pdflatex - enabling input (output) from (to) processes
2018-03-29 14:14:48,813+0200 INFO pdflatex - setting output directory: D:testout
2018-03-29 14:14:48,813+0200 INFO pdflatex - setting aux directory: D:testout
2018-03-29 14:14:49,610+0200 INFO pdflatex - finishing with exit code 0
This the log from a failed run (network service user):
2018-03-29 14:14:19,478+0200 INFO pdflatex - starting with command line: D:miktexmiktexbinx64pdflatex -output-directory=D:testout D:testintoken.tex
2018-03-29 14:14:19,478+0200 INFO pdflatex - allowing known shell commands
2018-03-29 14:14:19,478+0200 INFO pdflatex - enabling input (output) from (to) processes
2018-03-29 14:14:19,478+0200 INFO pdflatex - setting output directory: D:testout
2018-03-29 14:14:19,478+0200 INFO pdflatex - setting aux directory: D:testout
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Windows API error 5: Access is denied.
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Info: path="D:testintoken.tex"
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Source: LibrariesMiKTeXCorePathNamePathName.cpp
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Line: 156
2018-03-29 14:14:19,509+0200 INFO pdflatex - finishing with exit code 1
There seems to be an acces problem on some resource, but I can't figure out which. My test script running the command is allowed to read the content of the input .tex file, write in the output directory and the log directory, and pdflatex -help gives me no error.
I have already faced a very similar issue with TexLive, working fine when run under administrator account, but giving me a cryptic "fatal: Can't get long name for D:texlive" when run under Network Service.
Any advice or pointers would be welcome, thanks in advance.
installing windows filesystem-access
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
up vote
0
down vote
favorite
I'm trying to install a shared MikTex on a Windows server 2012, so my web application (Perl CGI / IIS 8) can generate PDF files on the fly through pdflatex, and send them to the user.
I managed to install MikTex 2.9.6637 (x64) on the server through full download on another machine and transferring the files (the server has no web access), and it does work from the command line.
However I have trouble when I try to run my command from a Perl / CGI script from the webserver, when I configure IIS to use anonymous authentication through the windows account Network Service: access denied.
When I use IIS windows authentication, and the script runs with my own windows account (admin), it runs fine. Definitely an access management problem.
I used the options found on this page
http://docs.miktex.org/2.9/manual/setupwiz.html
in order to configure all folders in a simple D:miktex_local on which i can grant all privileges to this network service, instead of the default / folders.
The only folder I did not manage to configure myself is the log directory that stays in:
C:ProgramDataMiKTeX2.9miktexlog
But I granted privileges on this one, and it does not seem to be used even when I manage to generate the pdf.
My test script can write in these folders and logs are generated.
I also test from the script that the user has r/w privileges on my in and out folders.
This is the log from a success run (admin user):
2018-03-29 14:14:48,797+0200 INFO pdflatex - starting with command line: D:miktexmiktexbinx64pdflatex -output-directory=D:testout D:testintoken.tex
2018-03-29 14:14:48,797+0200 WARN pdflatex - running with administrator privileges
2018-03-29 14:14:48,813+0200 INFO pdflatex - allowing known shell commands
2018-03-29 14:14:48,813+0200 INFO pdflatex - enabling input (output) from (to) processes
2018-03-29 14:14:48,813+0200 INFO pdflatex - setting output directory: D:testout
2018-03-29 14:14:48,813+0200 INFO pdflatex - setting aux directory: D:testout
2018-03-29 14:14:49,610+0200 INFO pdflatex - finishing with exit code 0
This the log from a failed run (network service user):
2018-03-29 14:14:19,478+0200 INFO pdflatex - starting with command line: D:miktexmiktexbinx64pdflatex -output-directory=D:testout D:testintoken.tex
2018-03-29 14:14:19,478+0200 INFO pdflatex - allowing known shell commands
2018-03-29 14:14:19,478+0200 INFO pdflatex - enabling input (output) from (to) processes
2018-03-29 14:14:19,478+0200 INFO pdflatex - setting output directory: D:testout
2018-03-29 14:14:19,478+0200 INFO pdflatex - setting aux directory: D:testout
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Windows API error 5: Access is denied.
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Info: path="D:testintoken.tex"
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Source: LibrariesMiKTeXCorePathNamePathName.cpp
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Line: 156
2018-03-29 14:14:19,509+0200 INFO pdflatex - finishing with exit code 1
There seems to be an acces problem on some resource, but I can't figure out which. My test script running the command is allowed to read the content of the input .tex file, write in the output directory and the log directory, and pdflatex -help gives me no error.
I have already faced a very similar issue with TexLive, working fine when run under administrator account, but giving me a cryptic "fatal: Can't get long name for D:texlive" when run under Network Service.
Any advice or pointers would be welcome, thanks in advance.
installing windows filesystem-access
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
ask at the miktex issue tracker on github.
– Ulrike Fischer
Mar 29 at 12:40
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to install a shared MikTex on a Windows server 2012, so my web application (Perl CGI / IIS 8) can generate PDF files on the fly through pdflatex, and send them to the user.
I managed to install MikTex 2.9.6637 (x64) on the server through full download on another machine and transferring the files (the server has no web access), and it does work from the command line.
However I have trouble when I try to run my command from a Perl / CGI script from the webserver, when I configure IIS to use anonymous authentication through the windows account Network Service: access denied.
When I use IIS windows authentication, and the script runs with my own windows account (admin), it runs fine. Definitely an access management problem.
I used the options found on this page
http://docs.miktex.org/2.9/manual/setupwiz.html
in order to configure all folders in a simple D:miktex_local on which i can grant all privileges to this network service, instead of the default / folders.
The only folder I did not manage to configure myself is the log directory that stays in:
C:ProgramDataMiKTeX2.9miktexlog
But I granted privileges on this one, and it does not seem to be used even when I manage to generate the pdf.
My test script can write in these folders and logs are generated.
I also test from the script that the user has r/w privileges on my in and out folders.
This is the log from a success run (admin user):
2018-03-29 14:14:48,797+0200 INFO pdflatex - starting with command line: D:miktexmiktexbinx64pdflatex -output-directory=D:testout D:testintoken.tex
2018-03-29 14:14:48,797+0200 WARN pdflatex - running with administrator privileges
2018-03-29 14:14:48,813+0200 INFO pdflatex - allowing known shell commands
2018-03-29 14:14:48,813+0200 INFO pdflatex - enabling input (output) from (to) processes
2018-03-29 14:14:48,813+0200 INFO pdflatex - setting output directory: D:testout
2018-03-29 14:14:48,813+0200 INFO pdflatex - setting aux directory: D:testout
2018-03-29 14:14:49,610+0200 INFO pdflatex - finishing with exit code 0
This the log from a failed run (network service user):
2018-03-29 14:14:19,478+0200 INFO pdflatex - starting with command line: D:miktexmiktexbinx64pdflatex -output-directory=D:testout D:testintoken.tex
2018-03-29 14:14:19,478+0200 INFO pdflatex - allowing known shell commands
2018-03-29 14:14:19,478+0200 INFO pdflatex - enabling input (output) from (to) processes
2018-03-29 14:14:19,478+0200 INFO pdflatex - setting output directory: D:testout
2018-03-29 14:14:19,478+0200 INFO pdflatex - setting aux directory: D:testout
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Windows API error 5: Access is denied.
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Info: path="D:testintoken.tex"
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Source: LibrariesMiKTeXCorePathNamePathName.cpp
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Line: 156
2018-03-29 14:14:19,509+0200 INFO pdflatex - finishing with exit code 1
There seems to be an acces problem on some resource, but I can't figure out which. My test script running the command is allowed to read the content of the input .tex file, write in the output directory and the log directory, and pdflatex -help gives me no error.
I have already faced a very similar issue with TexLive, working fine when run under administrator account, but giving me a cryptic "fatal: Can't get long name for D:texlive" when run under Network Service.
Any advice or pointers would be welcome, thanks in advance.
installing windows filesystem-access
I'm trying to install a shared MikTex on a Windows server 2012, so my web application (Perl CGI / IIS 8) can generate PDF files on the fly through pdflatex, and send them to the user.
I managed to install MikTex 2.9.6637 (x64) on the server through full download on another machine and transferring the files (the server has no web access), and it does work from the command line.
However I have trouble when I try to run my command from a Perl / CGI script from the webserver, when I configure IIS to use anonymous authentication through the windows account Network Service: access denied.
When I use IIS windows authentication, and the script runs with my own windows account (admin), it runs fine. Definitely an access management problem.
I used the options found on this page
http://docs.miktex.org/2.9/manual/setupwiz.html
in order to configure all folders in a simple D:miktex_local on which i can grant all privileges to this network service, instead of the default / folders.
The only folder I did not manage to configure myself is the log directory that stays in:
C:ProgramDataMiKTeX2.9miktexlog
But I granted privileges on this one, and it does not seem to be used even when I manage to generate the pdf.
My test script can write in these folders and logs are generated.
I also test from the script that the user has r/w privileges on my in and out folders.
This is the log from a success run (admin user):
2018-03-29 14:14:48,797+0200 INFO pdflatex - starting with command line: D:miktexmiktexbinx64pdflatex -output-directory=D:testout D:testintoken.tex
2018-03-29 14:14:48,797+0200 WARN pdflatex - running with administrator privileges
2018-03-29 14:14:48,813+0200 INFO pdflatex - allowing known shell commands
2018-03-29 14:14:48,813+0200 INFO pdflatex - enabling input (output) from (to) processes
2018-03-29 14:14:48,813+0200 INFO pdflatex - setting output directory: D:testout
2018-03-29 14:14:48,813+0200 INFO pdflatex - setting aux directory: D:testout
2018-03-29 14:14:49,610+0200 INFO pdflatex - finishing with exit code 0
This the log from a failed run (network service user):
2018-03-29 14:14:19,478+0200 INFO pdflatex - starting with command line: D:miktexmiktexbinx64pdflatex -output-directory=D:testout D:testintoken.tex
2018-03-29 14:14:19,478+0200 INFO pdflatex - allowing known shell commands
2018-03-29 14:14:19,478+0200 INFO pdflatex - enabling input (output) from (to) processes
2018-03-29 14:14:19,478+0200 INFO pdflatex - setting output directory: D:testout
2018-03-29 14:14:19,478+0200 INFO pdflatex - setting aux directory: D:testout
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Windows API error 5: Access is denied.
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Info: path="D:testintoken.tex"
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Source: LibrariesMiKTeXCorePathNamePathName.cpp
2018-03-29 14:14:19,509+0200 FATAL pdflatex - Line: 156
2018-03-29 14:14:19,509+0200 INFO pdflatex - finishing with exit code 1
There seems to be an acces problem on some resource, but I can't figure out which. My test script running the command is allowed to read the content of the input .tex file, write in the output directory and the log directory, and pdflatex -help gives me no error.
I have already faced a very similar issue with TexLive, working fine when run under administrator account, but giving me a cryptic "fatal: Can't get long name for D:texlive" when run under Network Service.
Any advice or pointers would be welcome, thanks in advance.
installing windows filesystem-access
installing windows filesystem-access
asked Mar 29 at 12:37
Spendius
1
1
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
ask at the miktex issue tracker on github.
– Ulrike Fischer
Mar 29 at 12:40
add a comment |
ask at the miktex issue tracker on github.
– Ulrike Fischer
Mar 29 at 12:40
ask at the miktex issue tracker on github.
– Ulrike Fischer
Mar 29 at 12:40
ask at the miktex issue tracker on github.
– Ulrike Fischer
Mar 29 at 12:40
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I got it.
I believe the error to originate from the same issue as texlive, from this line:
DWORD len = GetLongPathNameW(this->ToWideCharString().c_str(), longPathName, _MAX_PATH);
Turns out I have to give relative paths to my pdflatex command, for some reason it does not support absolute paths when ran from this network service account.
I moved my test/in and test/out in the wwwroot and it works after this small change:
D:miktexmiktexbinx64pdflatex -output-directory=texout texintoken.tex
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I got it.
I believe the error to originate from the same issue as texlive, from this line:
DWORD len = GetLongPathNameW(this->ToWideCharString().c_str(), longPathName, _MAX_PATH);
Turns out I have to give relative paths to my pdflatex command, for some reason it does not support absolute paths when ran from this network service account.
I moved my test/in and test/out in the wwwroot and it works after this small change:
D:miktexmiktexbinx64pdflatex -output-directory=texout texintoken.tex
add a comment |
up vote
0
down vote
I got it.
I believe the error to originate from the same issue as texlive, from this line:
DWORD len = GetLongPathNameW(this->ToWideCharString().c_str(), longPathName, _MAX_PATH);
Turns out I have to give relative paths to my pdflatex command, for some reason it does not support absolute paths when ran from this network service account.
I moved my test/in and test/out in the wwwroot and it works after this small change:
D:miktexmiktexbinx64pdflatex -output-directory=texout texintoken.tex
add a comment |
up vote
0
down vote
up vote
0
down vote
I got it.
I believe the error to originate from the same issue as texlive, from this line:
DWORD len = GetLongPathNameW(this->ToWideCharString().c_str(), longPathName, _MAX_PATH);
Turns out I have to give relative paths to my pdflatex command, for some reason it does not support absolute paths when ran from this network service account.
I moved my test/in and test/out in the wwwroot and it works after this small change:
D:miktexmiktexbinx64pdflatex -output-directory=texout texintoken.tex
I got it.
I believe the error to originate from the same issue as texlive, from this line:
DWORD len = GetLongPathNameW(this->ToWideCharString().c_str(), longPathName, _MAX_PATH);
Turns out I have to give relative paths to my pdflatex command, for some reason it does not support absolute paths when ran from this network service account.
I moved my test/in and test/out in the wwwroot and it works after this small change:
D:miktexmiktexbinx64pdflatex -output-directory=texout texintoken.tex
answered Mar 29 at 13:13
Spendius
1
1
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f423845%2fshared-miktex-install-on-windows-server-2012-to-generate-pdf-from-iis%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
ask at the miktex issue tracker on github.
– Ulrike Fischer
Mar 29 at 12:40